public ResourceSet? lastResourceSet;
}
- protected string? BaseNameField;
+ protected string BaseNameField;
protected Assembly? MainAssembly; // Need the assembly manifest sometimes.
private Dictionary<string, ResourceSet>? _resourceSets;
_lastUsedResourceCache = new CultureNameResourceSetPair();
ResourceManagerMediator mediator = new ResourceManagerMediator(this);
_resourceGroveler = new ManifestBasedResourceGroveler(mediator);
+ BaseNameField = string.Empty;
}
// Constructs a Resource Manager for files beginning with
}
// Gets the base name for the ResourceManager.
- public virtual string? BaseName
+ public virtual string BaseName
{
get { return BaseNameField; }
}
}
}
- public static ResourceManager CreateFileBasedResourceManager(string baseName, string resourceDir, Type usingResourceSet)
+ public static ResourceManager CreateFileBasedResourceManager(string baseName, string resourceDir, Type? usingResourceSet)
{
return new ResourceManager(baseName, resourceDir, usingResourceSet);
}
//
public virtual string? GetString(string name)
{
- return GetString(name, (CultureInfo?)null);
+ return GetString(name, null);
}
// Looks up a resource value for a particular name. Looks in the
//
public virtual object? GetObject(string name)
{
- return GetObject(name, (CultureInfo?)null, true);
+ return GetObject(name, null, true);
}
// Looks up a resource value for a particular name. Looks in the
// specified CultureInfo, and if not found, all parent CultureInfos.
// Returns null if the resource wasn't found.
- public virtual object? GetObject(string name, CultureInfo culture)
+ public virtual object? GetObject(string name, CultureInfo? culture)
{
return GetObject(name, culture, true);
}
public UnmanagedMemoryStream? GetStream(string name)
{
- return GetStream(name, (CultureInfo?)null);
+ return GetStream(name, null);
}
public UnmanagedMemoryStream? GetStream(string name, CultureInfo? culture)
// this is weird because we have BaseNameField accessor above, but we're sticking
// with it for compat.
- internal string? BaseName
+ internal string BaseName
{
get { return _rm.BaseName; }
}
{
// public constructor to form the custom attribute with constructor and constructor
// parameters.
- public CustomAttributeBuilder(ConstructorInfo con, object[] constructorArgs)
+ public CustomAttributeBuilder(ConstructorInfo con, object?[] constructorArgs)
{
InitCustomAttributeBuilder(con, constructorArgs,
new PropertyInfo[] { }, new object[] { },
// public constructor to form the custom attribute with constructor, constructor
// parameters and named properties.
- public CustomAttributeBuilder(ConstructorInfo con, object[] constructorArgs,
+ public CustomAttributeBuilder(ConstructorInfo con, object?[] constructorArgs,
PropertyInfo[] namedProperties, object[] propertyValues)
{
InitCustomAttributeBuilder(con, constructorArgs, namedProperties,
// public constructor to form the custom attribute with constructor and constructor
// parameters.
- public CustomAttributeBuilder(ConstructorInfo con, object[] constructorArgs,
+ public CustomAttributeBuilder(ConstructorInfo con, object?[] constructorArgs,
FieldInfo[] namedFields, object[] fieldValues)
{
InitCustomAttributeBuilder(con, constructorArgs, new PropertyInfo[] { },
// public constructor to form the custom attribute with constructor and constructor
// parameters.
- public CustomAttributeBuilder(ConstructorInfo con, object[] constructorArgs,
+ public CustomAttributeBuilder(ConstructorInfo con, object?[] constructorArgs,
PropertyInfo[] namedProperties, object[] propertyValues,
FieldInfo[] namedFields, object[] fieldValues)
{
return t == typeof(object);
}
- internal void InitCustomAttributeBuilder(ConstructorInfo con, object[] constructorArgs,
+ internal void InitCustomAttributeBuilder(ConstructorInfo con, object?[] constructorArgs,
PropertyInfo[] namedProperties, object[] propertyValues,
FieldInfo[] namedFields, object[] fieldValues)
{
// Cache information used elsewhere.
m_con = con;
- m_constructorArgs = new object[constructorArgs.Length];
+ m_constructorArgs = new object?[constructorArgs.Length];
Array.Copy(constructorArgs, 0, m_constructorArgs, 0, constructorArgs.Length);
Type[] paramTypes;
// Now verify that the types of the actual parameters are compatible with the types of the formal parameters.
for (i = 0; i < paramTypes.Length; i++)
{
- object constructorArg = constructorArgs[i];
+ object? constructorArg = constructorArgs[i];
if (constructorArg == null)
{
if (paramTypes[i].IsValueType)
}
internal ConstructorInfo m_con = null!;
- internal object[] m_constructorArgs = null!;
+ internal object?[] m_constructorArgs = null!;
internal byte[] m_blob = null!;
}
}
//
public DynamicMethod(string name,
- Type returnType,
- Type[] parameterTypes)
+ Type? returnType,
+ Type[]? parameterTypes)
{
Init(name,
MethodAttributes.Public | MethodAttributes.Static,
}
public DynamicMethod(string name,
- Type returnType,
- Type[] parameterTypes,
+ Type? returnType,
+ Type[]? parameterTypes,
bool restrictedSkipVisibility)
{
Init(name,
}
public DynamicMethod(string name,
- Type returnType,
- Type[] parameterTypes,
+ Type? returnType,
+ Type[]? parameterTypes,
Module m)
{
if (m == null)
}
public DynamicMethod(string name,
- Type returnType,
- Type[] parameterTypes,
+ Type? returnType,
+ Type[]? parameterTypes,
Module m,
bool skipVisibility)
{
public DynamicMethod(string name,
MethodAttributes attributes,
CallingConventions callingConvention,
- Type returnType,
- Type[] parameterTypes,
+ Type? returnType,
+ Type[]? parameterTypes,
Module m,
bool skipVisibility)
{
}
public DynamicMethod(string name,
- Type returnType,
- Type[] parameterTypes,
+ Type? returnType,
+ Type[]? parameterTypes,
Type owner)
{
if (owner == null)
}
public DynamicMethod(string name,
- Type returnType,
- Type[] parameterTypes,
+ Type? returnType,
+ Type[]? parameterTypes,
Type owner,
bool skipVisibility)
{
public DynamicMethod(string name,
MethodAttributes attributes,
CallingConventions callingConvention,
- Type returnType,
- Type[] parameterTypes,
+ Type? returnType,
+ Type[]? parameterTypes,
Type owner,
bool skipVisibility)
{
return m_tkMethod;
}
- public void SetParameters(params Type[]? parameterTypes)
+ public void SetParameters(params Type[] parameterTypes)
{
CheckContext(parameterTypes);