Click or drag to resize
ObjectFactory<T> Class
Class that provides construction of the objects of given class
Inheritance Hierarchy
System.Object
  CMS.Core.ObjectFactory<T>
    More...

Namespace: CMS.Core
Assembly: CMS.Core (in CMS.Core.dll) Version: 9.0.0
Syntax
C#
public class ObjectFactory<T> : IObjectFactory

Type Parameters

T

The ObjectFactory< T> type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyStatic memberCanReplaceCurrent
If true, the default object factory can be replaced by other factory
Protected propertyConstructor
Constructor used for dependency injection
Public propertyCreatedType
Returns the type created by this factory
Public propertyStatic memberCurrentFactory
Current factory to create objects, includes initialization of the core if interface factory is not initialized
Public propertyInitializer
Object initialization function
Public propertyStatic memberIsInitialized
Returns true if the default factory is initialized
Public propertySingleton
Singleton instance of the created object type
Protected propertyUseCompiledLambda
If true, the compiled lambda expression is used to create new objects. Set to true if the factory will be creating a lot of objects
Top
Methods
  NameDescription
Public methodCanCreateObject
Returns true if the factory is able to create the object based on the given parameter
Protected methodCreateActivator
Creates an object activator for the created type
Protected methodCreateInstance
Creates a new instance of the object
Public methodCreateNewObject
Creates and returns a new object
Public methodCreateNewTypedObject
Creates and returns a new object
Public methodStatic memberChangeCreatedTypeTo(Type)
Replaces the creation of the given original type by the new type
Public methodStatic memberChangeCreatedTypeTo<NewType>()
Replaces the creation of the given original type by the new type
Public methodStatic memberNew
Creates a new object of the given type
Public methodStatic memberReset
Resets the factory to a default state
Public methodStatic memberSetDefaultObjectTypeTo<NewType>
Sets the default object type created by the factory to the given type
Public methodStatic memberStaticSingleton()
Provides a static singleton instance of the object implementing this interface
Public methodStatic memberStaticSingleton<TParent>()
Returns static singleton for the given object type
Top
See Also
Inheritance Hierarchy