#region {0} private static readonly Lazy<IResourceString> Lazy{0} = new Lazy<IResourceString>( () => AddToCultureCache(new ResourceManagerString("{0}", {1}, GetDefaultCulture)), LazyThreadSafetyMode.PublicationOnly ); public static IResourceString {0} => Lazy{0}.Value; #endregion // {0} 0 = ResourceId, 1 = ResourceManagerPropertyName internal static class {0} {{ private static readonly Lazy<IResourceString> LazyFormat = new Lazy<IResourceString>( () => AddToCultureCache(new ResourceManagerString("{0}", {1}, GetDefaultCulture)), LazyThreadSafetyMode.PublicationOnly ); public static IResourceString Format => LazyFormat.Value; {2} }} 0 = ResourceId, 1 = ResourceManagerPropertyName, 2 = FromMethodDefinition public static IResourceString From({0}) => AddToCultureCache(new FormattedResourceString( Format, GetDefaultCulture, {1} )); 0 = FromMethodSignature, 1 = ParameterNames using ResourceString.Net.Contract; using System; using System.Globalization; using System.Resources; using System.Threading; namespace {0} {{ internal static class {1} {{ {2} {3} }} }} 0 = ns, 1 = ClassName, 2 = ResourceManagerRegion, 3 = ResourceRegions #region ResourceManager private static readonly Type _Type = typeof({1}); private static readonly Lazy<ResourceManager> _ResourceManager = new Lazy<ResourceManager>( () => new ResourceManager("{0}" ?? string.Empty, _Type.Assembly), LazyThreadSafetyMode.PublicationOnly ); public static ResourceManager ResourceManager => _ResourceManager.Value; private static CultureInfo GetDefaultCulture() {{ return CultureInfo.CurrentCulture; }} private static IResourceString AddToCultureCache(IResourceString source) {{ return new CultureBasedCachedString(source, GetDefaultCulture); }} #endregion // ResourceManager 0 = ResourceManagerTypeName, 1 = ClassName ResourceManager