Table of Contents

Class PropertySettings<InfoType>

Namespace
CMS.Base
Assembly
CMS.Base.dll

Settings object for general properties registering in BaseGenericInfo.

public class PropertySettings<InfoType>

Type Parameters

InfoType
Inheritance
object
PropertySettings<InfoType>
Extension Methods

Constructors

PropertySettings(string, Func<InfoType, object, object>, Action<InfoType, object, object>, object, Type)

Creates new instance of parametrized property with a setter

public PropertySettings(string name, Func<InfoType, object, object> lambdaExpr, Action<InfoType, object, object> setLambdaExpr, object parameter, Type propertyType)

Parameters

name string

Property name

lambdaExpr Func<InfoType, object, object>

Lamda expression for the getter of the property (object, parameter) => return value

setLambdaExpr Action<InfoType, object, object>

Lamda expression for the setter of the property (object, parameter, value) => set

parameter object

Parameter to pass to the lambda functions

propertyType Type

Property type

PropertySettings(string, Func<InfoType, object>, Action<InfoType, object>, Type)

Creates new instance of property

public PropertySettings(string name, Func<InfoType, object> lambdaExpr, Action<InfoType, object> setLambdaExpr, Type propertyType)

Parameters

name string

Property name

lambdaExpr Func<InfoType, object>

Lamda expression for the getter of the property

setLambdaExpr Action<InfoType, object>

Lamda expression for the setter of the property

propertyType Type

Property type

Fields

mEmptyObject

Empty object

protected object mEmptyObject

Field Value

object

mName

Property name

protected string mName

Field Value

string

mParameter

Parameter passed to the parametrized.

protected object mParameter

Field Value

object

mParametrizedFunction

Property getter with one parameter.

protected Func<InfoType, object, object> mParametrizedFunction

Field Value

Func<InfoType, object, object>

mParametrizedSetFunction

Property setter with one parameter

protected Action<InfoType, object, object> mParametrizedSetFunction

Field Value

Action<InfoType, object, object>

mPropertyFunction

Property getter without parameters.

protected Func<InfoType, object> mPropertyFunction

Field Value

Func<InfoType, object>

mPropertySetFunction

Property setter without parameters

protected Action<InfoType, object> mPropertySetFunction

Field Value

Action<InfoType, object>

mPropertyType

Property type

protected Type mPropertyType

Field Value

Type

Properties

EmptyObjectFactory

Object factory that provides an empty object to properly determine dynamic type

public IObjectFactory EmptyObjectFactory { get; set; }

Property Value

IObjectFactory

Hidden

If true, this property is hidden (doesn't report in properties list)

public bool Hidden { get; set; }

Property Value

bool

PropertyType

Property type

public Type PropertyType { get; set; }

Property Value

Type

Methods

Evaluate(InfoType)

Evaluates the property.

public object Evaluate(InfoType info)

Parameters

info InfoType

Info object to evaluate the lambda expression on

Returns

object

HasSetter()

Returns true if given property has a setter

public bool HasSetter()

Returns

bool

Set(InfoType, object)

Evaluates the property.

public void Set(InfoType info, object newValue)

Parameters

info InfoType

Info object to evaluate the lambda expression on

newValue object

New value to set to the property

SetEmptyObject(object)

Sets the empty object to the factory

public void SetEmptyObject(object obj)

Parameters

obj object