Table of Contents

Class Extension<TExtension>

Namespace
CMS.Base
Assembly
CMS.Base.dll

Storage for static extensions

public class Extension<TExtension>

Type Parameters

TExtension
Inheritance
object
Extension<TExtension>
Extension Methods

Methods

AddAsProperty(Type, string)

Adds the property to the given type

public static GenericExtension<TExtension> AddAsProperty(Type type, string propertyName)

Parameters

type Type

Type to which register the property

propertyName string

Property name

Returns

GenericExtension<TExtension>

AddAsStaticProperty(Type, string)

Adds the static property to the given type

public static GenericProperty<TExtension> AddAsStaticProperty(Type type, string propertyName)

Parameters

type Type

Type to which register the property

propertyName string

Property name

Returns

GenericProperty<TExtension>

AddTo(Type)

Adds the extension to the given type

public static GenericExtension<TExtension> AddTo(Type type)

Parameters

type Type

Type to which register the extension

Returns

GenericExtension<TExtension>

GetExtensions()

Returns the merged list of all the extensions for all the types.

public static IEnumerable<Lazy<TExtension>> GetExtensions()

Returns

IEnumerable<Lazy<TExtension>>

GetExtensionsForType(Type)

Gets all extensions for the given object type

public static ReadOnlyCollection<Lazy<TExtension>> GetExtensionsForType(Type type)

Parameters

type Type

Type to check

Returns

ReadOnlyCollection<Lazy<TExtension>>

GetExtensionsForType<ObjectType>()

Gets all extensions for the given object type

public static ReadOnlyCollection<Lazy<TExtension>> GetExtensionsForType<ObjectType>()

Returns

ReadOnlyCollection<Lazy<TExtension>>

Type Parameters

ObjectType

GetPropertiesForType(Type)

Gets all extensions for the given object type

public static SafeDictionary<string, GenericExtension<TExtension>> GetPropertiesForType(Type type)

Parameters

type Type

Type to check

Returns

SafeDictionary<string, GenericExtension<TExtension>>

GetPropertyForObject(object, string)

Gets all extensions for the given object

public static GenericExtension<TExtension> GetPropertyForObject(object obj, string propertyName)

Parameters

obj object

Object to process

propertyName string

Property name

Returns

GenericExtension<TExtension>

GetPropertyForType(Type, string)

Gets all extensions for the given object

public static GenericExtension<TExtension> GetPropertyForType(Type type, string propertyName)

Parameters

type Type

Type to search

propertyName string

Property name

Returns

GenericExtension<TExtension>

GetStaticPropertiesForObject(object)

Tries to get static properties for specific type

public static SafeDictionary<string, GenericProperty<TExtension>> GetStaticPropertiesForObject(object obj)

Parameters

obj object

Object to check

Returns

SafeDictionary<string, GenericProperty<TExtension>>

GetStaticPropertiesForSpecificType(Type)

Tries to get static properties for specific type

public static SafeDictionary<string, GenericProperty<TExtension>> GetStaticPropertiesForSpecificType(Type type)

Parameters

type Type

Type to check

Returns

SafeDictionary<string, GenericProperty<TExtension>>

GetStaticPropertiesForType(Type)

Gets all extensions for the given object type

public static SafeDictionary<string, GenericProperty<TExtension>> GetStaticPropertiesForType(Type type)

Parameters

type Type

Type to check

Returns

SafeDictionary<string, GenericProperty<TExtension>>

GetStaticPropertyForType(Type, string)

Tries to get property for specific type

public static GenericProperty<TExtension> GetStaticPropertyForType(Type type, string propertyName)

Parameters

type Type

Type to check

propertyName string

Property name

Returns

GenericProperty<TExtension>