Class GenericExtension<ExtensionType>
Generic extension container
public class GenericExtension<ExtensionType> : IGenericExtensionType Parameters
- ExtensionType
- Inheritance
- 
      objectGenericExtension<ExtensionType>
- Implements
- Derived
- 
      GenericProperty<PropertyType>
- Extension Methods
Constructors
GenericExtension()
public GenericExtension()Properties
Instance
Property value. Initializes the extension object if not available
public ExtensionType Instance { get; }Property Value
- ExtensionType
IsInitialized
Returns true if the extension is initialized
public bool IsInitialized { get; }Property Value
- bool
LazyInstance
Lazy instance of the extension
public Lazy<ExtensionType> LazyInstance { get; }Property Value
- Lazy<ExtensionType>
Name
Name of the extension
public virtual string Name { get; }Property Value
- string
ParentExtension
Parent extension. If set, provides instance object to current extension
public IGenericExtension ParentExtension { get; set; }Property Value
PropertyInitializer
Property initializer
protected Func<object, ExtensionType> PropertyInitializer { get; set; }Property Value
- Func<object, ExtensionType>
Methods
GetInstance()
Gets the extension object instance
public object GetInstance()Returns
- object
Initialize()
Initializes the extension
public ExtensionType Initialize()Returns
- ExtensionType
NewGenericProperty(object)
Creates a new property of the given type, initialized to the extension value
public IGenericProperty NewGenericProperty(object obj)Parameters
- objobject
- Parent object for the property 
Returns
NewProperty(object)
Creates a new property of the given type, initialized to the extension value
public GenericProperty<ExtensionType> NewProperty(object obj)Parameters
- objobject
- Parent object for the property 
Returns
- GenericProperty<ExtensionType>
NewValue()
Creates a new value of the given type
public ExtensionType NewValue()Returns
- ExtensionType
RegisterAsExtensionTo(Type)
Registers the extension as an extension to the given type
public void RegisterAsExtensionTo(Type type)Parameters
- typeType
- Target type 
RegisterAsPropertyTo(Type, string)
Registers the extension as a property to the given type
public void RegisterAsPropertyTo(Type type, string propertyName)Parameters
- typeType
- Target type 
- propertyNamestring
- Property name 
SetInstance(object)
Sets the extension object instance
public void SetInstance(object value)Parameters
- valueobject
- New instance value 
WithLazyInitialization(Func<object, ExtensionType>)
Sets up the lazy initialization over this property
public void WithLazyInitialization(Func<object, ExtensionType> initializer)Parameters
- initializerFunc<object, ExtensionType>
- Property initializer