Table of Contents

Class ObjectTypeManager

Namespace
CMS.DataEngine
Assembly
CMS.DataEngine.dll

Class with various types of object types.

public class ObjectTypeManager : AbstractHierarchicalObject<ObjectTypeManager>, IDataContainer, ISimpleDataContainer, IVirtualHierarchicalObject, IHierarchicalObject, INameIndexable
Inheritance
object
ObjectTypeManager
Implements
Inherited Members
Extension Methods

Fields

ObjectTypeListChanged

Raised when list of known object types has been changed.

public EventHandler ObjectTypeListChanged

Field Value

EventHandler

Properties

AllExceptBindingObjectTypes

Returns the list of all the object types available in the system in a not guaranteed order. Does not contain inherited object types and binding object types.

[RegisterProperty]
public static IEnumerable<string> AllExceptBindingObjectTypes { get; }

Property Value

IEnumerable<string>

AllObjectTypes

Returns the list of all the object types available in the system in a not guaranteed order. Does not contain inherited object types

[RegisterProperty]
public static IEnumerable<string> AllObjectTypes { get; }

Property Value

IEnumerable<string>

BindingObjectTypes

List of all binding object types.

[RegisterProperty]
public static IEnumerable<string> BindingObjectTypes { get; }

Property Value

IEnumerable<string>

ContinuousIntegrationSupportedObjectTypes

Returns the list of all object types that are supported by continuous integration.

[RegisterProperty(Hidden = true)]
public static IEnumerable<string> ContinuousIntegrationSupportedObjectTypes { get; }

Property Value

IEnumerable<string>

ExistingObjectTypes

Returns the list of all existing object types available in the system in a not guaranteed order (includes also inherited, list infos).

[RegisterProperty]
public static IEnumerable<string> ExistingObjectTypes { get; }

Property Value

IEnumerable<string>

Instance

Returns singleton instance of the ObjectTypeManager.

public static ObjectTypeManager Instance { get; }

Property Value

ObjectTypeManager

MainObjectTypes

List of all "main" object types (= not child of other object) retrieved from modules.

[RegisterProperty]
public static IEnumerable<string> MainObjectTypes { get; }

Property Value

IEnumerable<string>

ObjectTypesWithDynamicDependency

Returns the list of all the object types available in the system that has dynamic dependency in a not guaranteed order. Does not contain inherited object types

[RegisterProperty]
public static IEnumerable<string> ObjectTypesWithDynamicDependency { get; }

Property Value

IEnumerable<string>

ObjectTypesWithMacros

Returns the list of all the object types available in the system that can contain macros in a not guaranteed order. Does not contain inherited object types

[RegisterProperty]
public static IEnumerable<string> ObjectTypesWithMacros { get; }

Property Value

IEnumerable<string>

RegisteredTypes

Returns all registered types

public static IEnumerable<ObjectTypeInfo> RegisteredTypes { get; }

Property Value

IEnumerable<ObjectTypeInfo>

Methods

AddObjectDependency(ObjectTypeInfo, ObjectDependency)

Adds object dependency to the specified TypeInfo if it's not present yet.

public static void AddObjectDependency(ObjectTypeInfo typeInfo, ObjectDependency dependency)

Parameters

typeInfo ObjectTypeInfo

TypeInfo where to add dependencies

dependency ObjectDependency

Dependency to add

EnsureObjectTypeInfoDynamicList(ObjectTypeInfo)

Registers the specified type info to all lists where it belongs to (ObjectDependencies, ChildObjectTypes, BindingObjectTypes, OtherBindingObjectTypes).

public static void EnsureObjectTypeInfoDynamicList(ObjectTypeInfo typeInfo)

Parameters

typeInfo ObjectTypeInfo

Object type info to process

GetColumnNames(params string[])

Gets list of columns from given object types

[Obsolete("Method was not intended for public use and will be removed.")]
[ObsoleteSince(29, 2)]
public static List<string> GetColumnNames(params string[] objectTypes)

Parameters

objectTypes string[]

Object types

Returns

List<string>

GetObjectTypes(IEnumerable<string>, Func<ObjectTypeInfo, bool>)

Filters given source collection of object types according to the condition specified.

public static List<string> GetObjectTypes(IEnumerable<string> sourceCollection, Func<ObjectTypeInfo, bool> condition)

Parameters

sourceCollection IEnumerable<string>

Source collection to filter

condition Func<ObjectTypeInfo, bool>

Condition to filter with

Returns

List<string>

GetTypeInfo(string, bool)

Gets the type info for the given object type

public static ObjectTypeInfo GetTypeInfo(string objectType, bool exceptionIfNotFound = false)

Parameters

objectType string

Object type

exceptionIfNotFound bool

If true, an exception is fired if the given object type is not found

Returns

ObjectTypeInfo

GetTypeInfos(IEnumerable<string>, Func<ObjectTypeInfo, bool>)

Filters given source collection of object types according to the condition specified.

public static IEnumerable<ObjectTypeInfo> GetTypeInfos(IEnumerable<string> sourceCollection, Func<ObjectTypeInfo, bool> condition)

Parameters

sourceCollection IEnumerable<string>

Source collection to filter

condition Func<ObjectTypeInfo, bool>

Condition to filter with

Returns

IEnumerable<ObjectTypeInfo>

GetTypeInfos(Type)

Gets all the type infos registered for the given system type

public static IEnumerable<ObjectTypeInfo> GetTypeInfos(Type type)

Parameters

type Type

System type

Returns

IEnumerable<ObjectTypeInfo>

RegisterObjectType(string, ObjectTypeInfo, Type, bool, bool)

Registers the object type

public static void RegisterObjectType(string objectType, ObjectTypeInfo typeInfo, Type type, bool allowObjectTypeProviderRegistration = true, bool forceCollectionUpdate = false)

Parameters

objectType string

Object type to be registered.

typeInfo ObjectTypeInfo

TypeInfo configuration of the registered object type.

type Type

Type to be registered.

allowObjectTypeProviderRegistration bool

Indicates whether registration of a corresponding object type info provider into IoC container can be performed.

forceCollectionUpdate bool

Force update for lazy initialized object type collections.

Remarks

The method registers a corresponding IInfoProvider<TInfo> implementation into IoC container if typeInfo specifies the ProviderType to be registered and allowObjectTypeProviderRegistration is not false.

All object types must be registered during application pre-initialization. Registration into the IoC container cannot be performed after the container's initialization has finished.

Use the allowObjectTypeProviderRegistration parameter in scenarios when the IoC container is not available (i.e. unit tests). In such scenarios, the allowObjectTypeProviderRegistration must be false.

Exceptions

ArgumentException

Thrown when object type is either null or empty.

ArgumentNullException

Thrown when either type info or type is null.

RemoveObjectTypeInfoDynamicList(ObjectTypeInfo)

Removes the specified type info from all lists where it belongs to (ObjectDependencies, ChildObjectTypes, BindingObjectTypes, OtherBindingObjectTypes).

public static void RemoveObjectTypeInfoDynamicList(ObjectTypeInfo typeInfo)

Parameters

typeInfo ObjectTypeInfo

Object type info to remove.

UnregisterObjectType(string, Type)

Unregisters the object type.

public static void UnregisterObjectType(string objectType, Type type)

Parameters

objectType string

Object type to be unregistered.

type Type

Type to be unregistered.