fix resource class name generation -> 0.0.3

This commit is contained in:
2023-05-19 18:43:41 +00:00
parent 4c1f36e5f8
commit 2075b35f7b
9 changed files with 173 additions and 97 deletions

View File

@@ -12,18 +12,18 @@ namespace ResourceString.Net.Logic.Properties
#region ResourceManager
private static readonly Type _Type = typeof(Resources);
private static readonly Lazy<ResourceManager> _ResourceManager = new Lazy<ResourceManager>(
() => new ResourceManager(_Type.FullName ?? string.Empty, _Type.Assembly),
() => new ResourceManager("ResourceString.Net.Logic.Properties.Resources" ?? string.Empty, _Type.Assembly),
LazyThreadSafetyMode.PublicationOnly
);
public static ResourceManager ResourceManager => _ResourceManager.Value;
#endregion // ResourceManager
internal static class ResourceStringMembers
internal static class ResourceStringMembers
{
private static readonly Lazy<IResourceString> LazyFormat = new Lazy<IResourceString>(
() => new ResourceManagerString("ResourceStringMembers", ResourceManager, CultureInfo.CurrentCulture),
@@ -31,16 +31,16 @@ namespace ResourceString.Net.Logic.Properties
);
public static IResourceString Format => LazyFormat.Value;
public static IResourceString From(IResourceString resourceId, IResourceString resourceManagerPropertyName) => new FormattedResourceString(
Format,
Format,
resourceId,
resourceManagerPropertyName
);
}
internal static class ResourceFormatClassMembers
}
internal static class ResourceFormatClassMembers
{
private static readonly Lazy<IResourceString> LazyFormat = new Lazy<IResourceString>(
() => new ResourceManagerString("ResourceFormatClassMembers", ResourceManager, CultureInfo.CurrentCulture),
@@ -48,17 +48,17 @@ namespace ResourceString.Net.Logic.Properties
);
public static IResourceString Format => LazyFormat.Value;
public static IResourceString From(IResourceString resourceId, IResourceString resourceManagerPropertyName, IResourceString fromMethodDefinition) => new FormattedResourceString(
Format,
Format,
resourceId,
resourceManagerPropertyName,
fromMethodDefinition
);
}
internal static class ResourceFormatClassFromMethod
}
internal static class ResourceFormatClassFromMethod
{
private static readonly Lazy<IResourceString> LazyFormat = new Lazy<IResourceString>(
() => new ResourceManagerString("ResourceFormatClassFromMethod", ResourceManager, CultureInfo.CurrentCulture),
@@ -66,16 +66,16 @@ namespace ResourceString.Net.Logic.Properties
);
public static IResourceString Format => LazyFormat.Value;
public static IResourceString From(IResourceString fromMethodSignature, IResourceString parameterNames) => new FormattedResourceString(
Format,
Format,
fromMethodSignature,
parameterNames
);
}
internal static class ResourcesClassTemplate
}
internal static class ResourcesClassTemplate
{
private static readonly Lazy<IResourceString> LazyFormat = new Lazy<IResourceString>(
() => new ResourceManagerString("ResourcesClassTemplate", ResourceManager, CultureInfo.CurrentCulture),
@@ -83,18 +83,18 @@ namespace ResourceString.Net.Logic.Properties
);
public static IResourceString Format => LazyFormat.Value;
public static IResourceString From(IResourceString ns, IResourceString className, IResourceString resourceManagerRegion, IResourceString resourceRegions) => new FormattedResourceString(
Format,
Format,
ns,
className,
resourceManagerRegion,
resourceRegions
);
}
internal static class ResourceManagerMemberTemplate
}
internal static class ResourceManagerMemberTemplate
{
private static readonly Lazy<IResourceString> LazyFormat = new Lazy<IResourceString>(
() => new ResourceManagerString("ResourceManagerMemberTemplate", ResourceManager, CultureInfo.CurrentCulture),
@@ -102,14 +102,15 @@ namespace ResourceString.Net.Logic.Properties
);
public static IResourceString Format => LazyFormat.Value;
public static IResourceString From(IResourceString resourceManagerTypeName) => new FormattedResourceString(
Format,
public static IResourceString From(IResourceString className, IResourceString resourceManagerTypeName) => new FormattedResourceString(
Format,
className,
resourceManagerTypeName
);
}
}
#region DefaultPropertyName_ResourceManager
private static readonly Lazy<IResourceString> LazyDefaultPropertyName_ResourceManager = new Lazy<IResourceString>(
@@ -120,6 +121,6 @@ namespace ResourceString.Net.Logic.Properties
public static IResourceString DefaultPropertyName_ResourceManager => LazyDefaultPropertyName_ResourceManager.Value;
#endregion // DefaultPropertyName_ResourceManager
}
}
}