Class AbstractHierarchicalObject<TObject>
Abstract class for the hierarchical objects
public abstract class AbstractHierarchicalObject<TObject> : AbstractDataContainer<TObject>, IDataContainer, ISimpleDataContainer, IVirtualHierarchicalObject, IHierarchicalObject, INameIndexable where TObject : AbstractHierarchicalObject<TObject>
Type Parameters
TObject
- Inheritance
-
objectAbstractSimpleDataContainer<TObject>AbstractDataContainer<TObject>AbstractHierarchicalObject<TObject>
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
AbstractHierarchicalObject()
protected AbstractHierarchicalObject()
Properties
this[string]
Gets the value of particular property
public override object this[string name] { get; set; }
Parameters
namestringProperty name
Property Value
- object
Properties
Properties available through the context.
public virtual List<string> Properties { get; }
Property Value
- List<string>
PropertyList
Used property list
protected List<string> PropertyList { get; set; }
Property Value
- List<string>
RegisteredProperties
Registered properties
protected RegisteredProperties<TObject> RegisteredProperties { get; }
Property Value
- RegisteredProperties<TObject>
RegisteredPropertiesObject
Registered properties object
protected RegisteredProperties<TObject> RegisteredPropertiesObject { get; set; }
Property Value
- RegisteredProperties<TObject>
UseLocalProperties
If true, the object uses local properties
protected bool UseLocalProperties { get; set; }
Property Value
- bool
Methods
CombineWith(List<string>, List<object>, params TObject[])
Combines current instance with other properties (modifies current instace!). List properties are merged from all the participating typeinfos, other properties are taken as first non-null value (non-null is determined by nullValues collection).
public void CombineWith(List<string> excludedProperties, List<object> nullValues, params TObject[] objToMergeWith)
Parameters
excludedPropertiesList<string>Properties which should be ignored by the merging process
nullValuesList<object>Values which are considered as null values (value not specified)
objToMergeWithTObject[]Objects to be merged with current instance
GetProperty(string)
Gets the context property.
public virtual object GetProperty(string name)
Parameters
namestringProperty name
Returns
- object
GetPropertyType(string)
Gets the type of the given property
protected virtual Type GetPropertyType(string columnName)
Parameters
columnNamestringProperty name
Returns
- Type
HasSetter(string)
Returns true if given property has a setter
public bool HasSetter(string columnName)
Parameters
columnNamestringColumn name
Returns
- bool
RegisterProperties()
Registers the properties of this object
protected virtual void RegisterProperties()
RegisterProperty(string, Func<TObject, object>)
Registers the given property to the object
protected PropertySettings<TObject> RegisterProperty(string propertyName, Func<TObject, object> ex)
Parameters
propertyNamestringProperty name
exFunc<TObject, object>Lambda expression
Returns
- PropertySettings<TObject>
RegisterProperty(string, object, Func<TObject, object, object>)
Registers the given parameterized property to the object.
protected PropertySettings<TObject> RegisterProperty(string propertyName, object parameter, Func<TObject, object, object> ex)
Parameters
propertyNamestringProperty name
parameterobjectParameter for the lambda expression
exFunc<TObject, object, object>Lambda expression
Returns
- PropertySettings<TObject>
RegisterProperty<TProperty>(string, Func<TObject, object>)
Registers the given property to the object
protected PropertySettings<TObject> RegisterProperty<TProperty>(string propertyName, Func<TObject, object> ex)
Parameters
propertyNamestringProperty name
exFunc<TObject, object>Lambda expression
Returns
- PropertySettings<TObject>
Type Parameters
TProperty
SetProperty(string, object)
Gets the context property.
public virtual bool SetProperty(string name, object value)
Parameters
namestringProperty name
valueobjectValue to set
Returns
- bool
TryGetProperty(string, out object)
Gets the context property.
public virtual bool TryGetProperty(string name, out object value)
Parameters
namestringProperty name
valueobjectReturning the value
Returns
- bool
TryGetProperty(string, out object, bool)
Returns value of property.
public virtual bool TryGetProperty(string columnName, out object value, bool notNull)
Parameters
columnNamestringColumn name
valueobjectReturns the value
notNullboolIf true, the property attempts to return non-null values, at least it returns the empty object of the correct type
Returns
- bool
Returns true if the operation was successful (the value was present)