ResolveTypeOptions Enumeration

Provides options for the Reflector.ResolveType methods.

Definition

Namespace: KGySoft.Reflection
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0-preview.1
C#
[FlagsAttribute]
public enum ResolveTypeOptions

Members

None0x00

Represents no enabled options.

TryToLoadAssemblies0x01

If this flag is enabled, then the Reflector.ResolveType methods try to load the assemblies optionally present in the type name if they are not loaded yet. Otherwise, the assemblies are tried to be located among the already loaded assemblies.

Default state at Reflector.ResolveType methods: Enabled

AllowPartialAssemblyMatch0x02

If this flag is enabled, then the Reflector.ResolveType methods allow to resolve assembly names optionally present in the type name by partial name. If this flag is disabled, then the provided assembly information must match (which still can be partially specified).

If a type name is specified without an assembly, then this flag is ignored (as if the AllowIgnoreAssemblyName was set).

  Note

Depending on the type system of the current platform it can happen that new assemblies of unmatching identity are loaded even if this flag is disabled. In such case the loaded assemblies are ignored.

  Tip

Forwarded types can be loaded even if this flag is disabled but only if the old assembly of the exact identity can be resolved. So for example, to allow a type, which was forwarded from the mscorlib 4.0 assembly, to be resolved by an mscorlib 2.0 identity, this flag should be enabled.

Default state at Reflector.ResolveType methods: Enabled

AllowIgnoreAssemblyName0x04

If a type is specified with an assembly name, which cannot be resolved at all, then this flag makes possible to completely ignore the assembly information and that the Reflector.ResolveType methods can return a type by its full name from any loaded assembly.

If a type name is specified without an assembly, then it will be tried to be resolved from the loaded assemblies as if this flag was enabled.

If this flag is enabled, then the AllowPartialAssemblyMatch flag is ignored.

Default state at Reflector.ResolveType methods: Disabled

IgnoreCase0x08

If this flag is enabled, then the type name is identified in a case-insensitive manner.

  Note

Assembly name is always resolved in a case-insensitive manner.

Default state at Reflector.ResolveType methods: Disabled

ThrowError0x10

If this flag is enabled and the type cannot be resolved, then a ReflectionException will be thrown from the Reflector.ResolveType methods.

Default state at Reflector.ResolveType methods: Disabled

See Also