Class IntentTypeRegistry
- Namespace
- IntentSharp.Catalog
- Assembly
- IntentSharp.Catalog.dll
The .NET types intent files may name in shape.clrType. Only registered types resolve, so a file can never make
the runtime load or instantiate an arbitrary type. Add<T>() registers a type under its simple name, its
full name and its assembly-qualified name (with or without version details); Add(string, Type) adds an
alias, which always wins over a simple name. When two registered types share a simple name, that simple name stops
resolving and the full names must be used. Names ignore case. Safe to use from several threads.
public sealed class IntentTypeRegistry : IIntentTypeRegistry
- Inheritance
-
objectIntentTypeRegistry
- Implements
- Inherited Members
-
object.Equals(object)object.Equals(object, object)object.GetHashCode()object.GetType()object.ReferenceEquals(object, object)object.ToString()
- Extension Methods
Constructors
- IntentTypeRegistry()
Creates an empty registry: no type name resolves until a type is added.
Properties
- Names
The names files can use (assembly-qualified forms are left out for brevity but resolve too).
Methods
- Add(string, Type)
Registers
typeunder an alias that files can use, for exampleInvoiceforContoso.Billing.InvoiceV2.
- Add(Type)
Registers
typeunder its simple, full and assembly-qualified names. Registering the same type again changes nothing.
- Add<T>()
Registers
Tunder its simple, full and assembly-qualified names.
- IsAmbiguous(string)
True when
nameis a simple name shared by two registered types (use the full name instead).
- TryResolve(string, out Type)
Resolves
name, ignoring case and surrounding white space: an alias, a simple name only one registered type has, a full name, or an assembly-qualified name. Returns false, withtypenull, for a null, blank, ambiguous or unregistered name.