Any metadata can be obtained through the class Information
with a set of static methods.
Below are the most frequently used class methods Information
grouped by use.
Work with object properties (determination of value, utilization, etc., value)
GetPropValueByName
Assign: Get the value of a property of the data object for the property name
Settings:
obj
- data Object, the property value for which you want topropName
- the property Name of a data object whose value you want to
Signature:
static public object GetPropValueByName(DataObject obj, string propName)
SetPropValueByName
Assign: to Set the value property of a data object for the property name, value is string. When setting a property you are trying to convert a string value to a value of the appropriate type by calling the static method Parse(string) from the type.
Settings:
obj
- data Object, the property value of which is determined by this methodpropName
- the property Name of a data object whose value is set by this methodPropValue
the value of the property of the data object that will be set by this method
Signature:
static public void SetPropValueByName(DataObject obj, string propName, string PropValue)
SetPropValueByName
Assign: to Set the value property of a data object for the property name, the value is transferred timisoreana. If the type conversion fails, returns an error message.
Signature:
static public void SetPropValueByName(DataObject obj, string propName, object PropValue)
TrimmedStringStorage
Assign: to Trim or string for this property.
Settings:
tp
- type data objectpropName
- the property Name of the data object
Signature:
static public bool TrimmedStringStorage(System.Type tp, string propname)
IsStoredProperty
Assign: if Stored property
Settings:
type
- .Net class type of the data objectpropName
- the property name
Signature:
static public bool IsStoredProperty(Type type, string propName)
GetPropertyNotNull
Assign: Check if for the specified .Net-properties attribute NotNullAttribute
Settings:
type
- .Net class type of the data objectproperty
- the property name
The result is: true if installed, false otherwise
Signature:
static public bool GetPropertyNotNull(System.Type type, string property)
GetPropertyStrLen
Assign: Get the specified .Net-properties attribute StrLenAttribute
.
Settings:
type
- .Net class type of the data objectproperty
- the property name
The result is: value of the set attribute (-1 if not set)
Signature:
static public int GetPropertyStrLen(System.Type type, string property)
GetPropertyType
Assign: To .Net-type properties of the class of the data object for the property name
Settings:
declarationType
- .Net class type of the data objectpropname
- the property name
Signature:
static public Type GetPropertyType(System.Type declarationType, string propname)
CheckPropertyExist
Assign: to Check whether such a property in the specified type
Settings:
type
- .Net class type of the data objectpropName
- the property Name
The result is:
true
- the property is,false
- no
Signature:
static public bool CheckPropertyExist(System.Type type, string propName)
ExtractPropertyName
Appointment_: Retrieval of properties within the current class
Settings:
propertyExpression
- Lambda expression for property accessTSource
- Type class source
The result is: the name of the property (single!)
Signature:
public static string ExtractPropertyName<TSource>(Expression<Func<TSource>> propertyExpression)
Cm. Access to own object attributes and attributes of related objects.
ExtractPropertyName
Assign: Explicit extraction of properties by type
Settings:
propertyExpression
- Lambda expression for property accessTSource
- Type class source
The result is: the name of the property (single!)
Signature:
public static string ExtractPropertyName<TSource>(Expression<Func<TSource, object>> propertyExpression)
ExtractPropertyPath
Assign: a Recursive method to get the path for the property specified via a nested lambda.A lambda expression can contain nested appeal to the masters.
Settings:
TProperty
- Type propertiespropertyExpression
- Lambda expression for property access
The result is: the Full path to a property (separation point)
Signature:
public static string ExtractPropertyPath<TProperty>(Expression<Func<TProperty>> propertyExpression)
ExtractPropertyPath
Assign: a Recursive method to get the path for the property specified via a nested lambda.A lambda expression can contain nested appeal to the masters.
Settings:
propertyExpression
- Lambda expression for property accessTSource
- Type class source
The result is: the Full path to a property (separation point)
Signature:
public static string ExtractPropertyPath<TSource>(Expression<Func<TSource, object>> propertyExpression)
ExtractPropertyInfo
Assign: Explicit extraction of properties by type
Settings:
propertyExpression
- Lambda expression for property accessTSource
- Type class source
The result is: PropertyInfo
properties (the latest)
Signature:
public static PropertyInfo ExtractPropertyInfo<TSource>(Expression<Func<TSource, object>> propertyExpression)
Work with views
GetView
Assign: to Get an idea on his name, and the class of the data object
Signature:
static public View GetView(string ViewName, System.Type type)
GetCompatibleView
Assign: to Get an idea, “compatible” with the given classes. Looking for a common ancestor, then trying to get the specified performance. If the view is not found, returns null.
Settings:
ViewName
- the name of the viewtypes
- one-dimensional array types data classes
Signature:
static public View GetCompatibleView(string ViewName, System.Type[] types)
AllViews
Assign: Get a list of names of views for the specified class of data object
Settings:
type
- class data object
Return value: Array of strings containing the names of the views for the specified type
Signature:
static public string[] AllViews(System.Type type)
AllViews
Assign: Get a list of the names of the General ideas for these classes. We are talking about a situation when forming an inheritance hierarchy classes have representation, which means that there is a set of representations common to a plurality of classes. Pointing to this method is a lot of classes, You will receive the names of their General ideas.
Signature:
static public string[] AllViews(params System.Type[] types)
CheckViewForClasses
Assign: to Test whether the specified named view in all these classes. We are talking about a situation when forming an inheritance hierarchy classes have representation, which means that there is a set of representations common to a plurality of classes.
Signature:
static public bool CheckViewForClasses(string ViewName, params System.Type[] types)
GetAllTypesFromView
Assign: Return a list of all instances of view types, including detaily.
Settings:
view
- View
Return value: types List without duplicates
Signature:
public static List<Type> GetAllTypesFromView(View view)
GetAllTypesFromView
Assign: Return a list of all instances of view types, including detaily and pseudometal.
Settings:
view
- Extended view (pseudocatalase).
Return value: types List without duplicates
Signature:
public static List<Type> GetAllTypesFromView(ExtendedView view)
Working with data objects
GetAlteredPropertyNames
Assign: to Compare two data object and return a list of distinguished .Net-properties. (Object or property with the attribute NotStored
проверяться will not)
Settings:
obj1
- 1-th data objectobj2
- 2-y data objectWithDetailsComparing
with comparing dealova objects
Return value: the one-dimensional string array of property names
Signature:
static public string[] GetAlteredPropertyNames(DataObject obj1, DataObject obj2, bool WithDetailsComparing)
GetAlteredProperyNames
Assign: Use the GetAlteredPropertyNames. Left for compatibility reasons(a mistake in a method name).
GetAlteredPropertyNamesWithNotStored
Assign: to Compare two data object and return a list of distinguished .Net-properties. (NotStored attributes are not ignored and is also checked along with the rest)
Settings:
obj1
- 1-th data objectobj2
- 2-y data objectWithDetailsComparing
with comparing dealova objects
Return value: the one-dimensional string array of property names
Signature:
static public string[] GetAlteredPropertyNamesWithNotStored(DataObject obj1, DataObject obj2, bool WithDetailsComparing)
ContainsAlteredProps
Assign: to Compare two data object and return true if the objects differ
Signature:
static public bool ContainsAlteredProps(DataObject obj1, DataObject obj2, bool WithDetailsComparing)
CheckNotNullAttributes
Assign: Check for non-null values to NotNull .Net properties.
Settings:
dataObject
- data object
Return value: returns null if no non-empty values, otherwise the one-dimensional string array with property names where the value is
Signature:
static public string[] CheckNotNullAttributes(DataObject dataObject)
GetAllPropertyNames
Assign: Return all names .Net-properties for .Net class type of the data object
Settings:
type
- .Net class type of the data object
Return value: the one-dimensional string array of property names
Signature:
static public string[] GetAllPropertyNames(System.Type type)
Information about the generator of primary keys
GetKeyGeneratorType
Assign: Get the type of the key generator
Settings:
typeofdataobject
- for what type
Signature:
static public System.Type GetKeyGeneratorType(System.Type typeofdataobject)
the Names of storage objects
GetTypeStorageName
Assign: the name of the store for the type
Signature:
static public string GetTypeStorageName(System.Type type)
GetClassStorageName
Assign: to Obtain the name of the store .Net class type of the data object specified by the attribute ClassStorageAttribute
.
Settings:
type
- .Net class type of the data object
Return value: the name of the store in line
Signature:
static public string GetClassStorageName(System.Type type)
GetPrimaryKeyStorageName
Assign: the name to store the primary key specified by the attribute PrimaryKeyStorageAttribute
Settings:
type
- .Net class type of the data object
Signature:
static public string GetPrimaryKeyStorageName(System.Type type)
GetPropertyStorageName
Assign: to Obtain the name of the store .Net-properties set by the attribute PropertyStorageAttribute
.
Signature:
static public string GetPropertyStorageName(System.Type type, string property, int index)
A more detailed description of this method can be found in Information.GetPropertyStorageName.
the authentication object attributes
CheckAccessToAttribute
Assign: Checking rights to object attributes. The method is a wrapper for the method CheckAccessToAttribute class ICSSoft.STORMNET.RightManager
and used to verify the rights in Get’erach computable properties of the DataObject. Processing of the masters is not subject to.
Settings:
type
- .Net class type of the data objectpropertyName
- the property Name of the data object, which checks the rights.deniedAccessValue
- the attribute Value in the absence of rights.
Signature:
public static bool CheckAccessToAttribute(Type type, string propertyName, out object deniedAccessValue)
Working with images
GetImageForInstance
Assign: Return a picture object
Signature:
public static System.Drawing.Image GetImageForInstance(DataObject dobject)
GetClassImage
Assign: to Return the picture to the class, set the attribute ClassImageFileAttribute
.
Settings:
dataObjectType
- data Object in this class
Return value: Image
Signature:
public static System.Drawing.Image GetClassImage(System.Type dataObjectType)
GetClassImageProperty
Assign: Return property-the image specified by the attribute ClassImagePropertyAttribute
Signature:
public static string GetClassImageProperty(System.Type dataobjectType)