Energy Core Library
Energy.Base.Class Class Reference

Classes

class  Information
 Object class information. More...
 
class  Repository
 Class information repository More...
 

Public Member Functions

delegate bool TypeFilter (Type type)
 

Static Public Member Functions

static object GetDefault (Type type)
 
static T GetDefault< T > ()
 
static string [] GetFieldsAndProperties (Type type, bool includePrivate, bool includePublic)
 Get list of names of all fields and propeties for specified class type. More...
 
static string [] GetFieldsAndProperties (Type type)
 Get list of names of all fields and propeties for specified class type. More...
 
static string [] GetFieldsAndProperties (Type type, bool includePrivate)
 Get list of names of all fields and propeties for specified class type. More...
 
static object GetFieldOrPropertyAttribute (Type type, string name, Type attribute)
 Get attribute for a field or property of desired class. More...
 
static object [] GetFieldOrPropertyAttributes (Type type, string field, Type filter, bool inherit, bool ignoreCase)
 Get custom attributes of field or property of a class. More...
 
static T [] GetFieldOrPropertyAttributes< T > (Type type, string field, bool inherit, bool ignoreCase)
 Get custom attributes of field or property of a class. More...
 
static object [] GetFieldOrPropertyAttributes (Type type, string field, Type filter)
 Get custom attributes of field or property of a class. More...
 
static FieldInfo FindFieldInfo (Type type, string name, bool includePrivate, bool ignoreCase)
 Find field in a class optionally including private or return null if field was not found. More...
 
static PropertyInfo FindPropertyInfo (Type type, string name, bool includePrivate, bool ignoreCase)
 Find property in a class optionally including private or return null if field was not found. More...
 
static object GetFieldValue (object o, string name, bool includePrivate, bool ignoreCase)
 Get field value of object. More...
 
static object GetPropertyValue (object o, string name, bool includePrivate, bool ignoreCase, object index)
 Get property value of object. More...
 
static object GetFieldOrPropertyValue (object o, string name, bool includePrivate, bool ignoreCase)
 Get field or property value of object. More...
 
static object GetFieldOrPropertyValue (object o, string name, bool includePrivate)
 Get field or property value of object. More...
 
static object GetFieldOrPropertyValue (object o, string name)
 Get field or property value of object. More...
 
static string [] ObjectToStringArray (object o, bool includePrivate, bool includeName)
 Represent values of fields and properties of object as string array. If names should be included, array will be returned as a set of key and value pairs one by another. More...
 
static object GetClassAttribute (Type type, Type attribute)
 Get desired attribute for a class or null if not found. More...
 
static object GetValueWithAttribute (object o, Type attribute)
 Get value of a first field or property of object with custom attribute. More...
 
static object [] GetValuesWithAttribute (object item, Type attribute, bool includePrivate, int max)
 Get values of all fields and properties of object with custom attribute. More...
 
static IEnumerable GetObjectsOfType (IEnumerable list, Type type)
 Get list of objects of specified type from list. More...
 
static Type GetClassInterface (Type classType, Type interfaceType)
 
static Type GetClassInterface (Type classType, string interfaceName)
 
static Type [] GetTypes (Assembly[] assemblies, TypeFilter filter)
 
static Type [] GetTypes (Assembly[] assemblies)
 
static Type [] GetTypes (Assembly assembly)
 
static Type [] GetTypes (Assembly assembly, TypeFilter filter)
 
static System.Reflection.Assembly [] GetAssemblies ()
 Get list of assemblies of current application domain More...
 
static System.Reflection.Assembly [] GetAssemblies (Energy.Enumeration.MatchMode matchMode, params string[] filters)
 Get list of assemblies of current application domain filtered... More...
 
static System.Reflection.Assembly [] GetAssemblies (params string[] filters)
 Get list of assemblies of current application domain filtered... More...
 
static Energy.Base.Collection.StringDictionary< Assembly > GetAssembliesDictionaryByShortName (Assembly[] assemblies)
 Create string dictionary of assemblies by their short names. More...
 
static Energy.Base.Collection.StringDictionary< Assembly > GetAssembliesDictionaryByFullName (Assembly[] assemblies)
 Create string dictionary of assemblies by their full names. More...
 
static Dictionary< string, string > GetAssemblyVersionsDictionaryByShortName (System.Reflection.Assembly[] assemblies)
 Create string dictionary of short assembly name as key and version as value. More...
 

Member Function Documentation

◆ FindFieldInfo()

static FieldInfo Energy.Base.Class.FindFieldInfo ( Type  type,
string  name,
bool  includePrivate,
bool  ignoreCase 
)
static

Find field in a class optionally including private or return null if field was not found.

Parameters
type
name
includePrivate
ignoreCase
Returns

◆ FindPropertyInfo()

static PropertyInfo Energy.Base.Class.FindPropertyInfo ( Type  type,
string  name,
bool  includePrivate,
bool  ignoreCase 
)
static

Find property in a class optionally including private or return null if field was not found.

Parameters
type
name
includePrivate
ignoreCase
Returns

◆ GetAssemblies() [1/3]

static System.Reflection.Assembly [] Energy.Base.Class.GetAssemblies ( )
static

Get list of assemblies of current application domain

Returns

◆ GetAssemblies() [2/3]

static System.Reflection.Assembly [] Energy.Base.Class.GetAssemblies ( Energy.Enumeration.MatchMode  matchMode,
params string []  filters 
)
static

Get list of assemblies of current application domain filtered...

Parameters
matchMode
filters
Returns

◆ GetAssemblies() [3/3]

static System.Reflection.Assembly [] Energy.Base.Class.GetAssemblies ( params string []  filters)
static

Get list of assemblies of current application domain filtered...

Parameters
filters
Returns

◆ GetAssembliesDictionaryByFullName()

static Energy.Base.Collection.StringDictionary<Assembly> Energy.Base.Class.GetAssembliesDictionaryByFullName ( Assembly []  assemblies)
static

Create string dictionary of assemblies by their full names.

Parameters
assemblies
Returns

◆ GetAssembliesDictionaryByShortName()

static Energy.Base.Collection.StringDictionary<Assembly> Energy.Base.Class.GetAssembliesDictionaryByShortName ( Assembly []  assemblies)
static

Create string dictionary of assemblies by their short names.

Parameters
assemblies
Returns

◆ GetAssemblyVersionsDictionaryByShortName()

static Dictionary<string, string> Energy.Base.Class.GetAssemblyVersionsDictionaryByShortName ( System.Reflection.Assembly []  assemblies)
static

Create string dictionary of short assembly name as key and version as value.

Parameters
assemblies
Returns

◆ GetClassAttribute()

static object Energy.Base.Class.GetClassAttribute ( Type  type,
Type  attribute 
)
static

Get desired attribute for a class or null if not found.

Parameters
type
attribute
Returns

◆ GetClassInterface() [1/2]

static Type Energy.Base.Class.GetClassInterface ( Type  classType,
Type  interfaceType 
)
static

◆ GetClassInterface() [2/2]

static Type Energy.Base.Class.GetClassInterface ( Type  classType,
string  interfaceName 
)
static

◆ GetDefault()

static object Energy.Base.Class.GetDefault ( Type  type)
static

◆ GetDefault< T >()

static T Energy.Base.Class.GetDefault< T > ( )
static

◆ GetFieldOrPropertyAttribute()

static object Energy.Base.Class.GetFieldOrPropertyAttribute ( Type  type,
string  name,
Type  attribute 
)
static

Get attribute for a field or property of desired class.

Parameters
typeClass type
nameField or property name
attributeAttribute class type
Returns
Attribute or null if not found

◆ GetFieldOrPropertyAttributes() [1/2]

static object [] Energy.Base.Class.GetFieldOrPropertyAttributes ( Type  type,
string  field,
Type  filter,
bool  inherit,
bool  ignoreCase 
)
static

Get custom attributes of field or property of a class.

Parameters
type
field
filter
inherit
ignoreCase
Returns

◆ GetFieldOrPropertyAttributes() [2/2]

static object [] Energy.Base.Class.GetFieldOrPropertyAttributes ( Type  type,
string  field,
Type  filter 
)
static

Get custom attributes of field or property of a class.

Parameters
type
field
filter
Returns

◆ GetFieldOrPropertyAttributes< T >()

static T [] Energy.Base.Class.GetFieldOrPropertyAttributes< T > ( Type  type,
string  field,
bool  inherit,
bool  ignoreCase 
)
static

Get custom attributes of field or property of a class.

Parameters
type
field
inherit
ignoreCase
Returns

◆ GetFieldOrPropertyValue() [1/3]

static object Energy.Base.Class.GetFieldOrPropertyValue ( object  o,
string  name,
bool  includePrivate,
bool  ignoreCase 
)
static

Get field or property value of object.

Parameters
o
name
includePrivate
ignoreCase
Returns

◆ GetFieldOrPropertyValue() [2/3]

static object Energy.Base.Class.GetFieldOrPropertyValue ( object  o,
string  name,
bool  includePrivate 
)
static

Get field or property value of object.

Parameters
o
name
includePrivate
Returns

◆ GetFieldOrPropertyValue() [3/3]

static object Energy.Base.Class.GetFieldOrPropertyValue ( object  o,
string  name 
)
static

Get field or property value of object.

Parameters
o
name
Returns

◆ GetFieldsAndProperties() [1/3]

static string [] Energy.Base.Class.GetFieldsAndProperties ( Type  type,
bool  includePrivate,
bool  includePublic 
)
static

Get list of names of all fields and propeties for specified class type.

Parameters
type
includePrivate
includePublic
Returns

◆ GetFieldsAndProperties() [2/3]

static string [] Energy.Base.Class.GetFieldsAndProperties ( Type  type)
static

Get list of names of all fields and propeties for specified class type.

Parameters
typeClass type
Returns
Array of string

◆ GetFieldsAndProperties() [3/3]

static string [] Energy.Base.Class.GetFieldsAndProperties ( Type  type,
bool  includePrivate 
)
static

Get list of names of all fields and propeties for specified class type.

Parameters
typeClass type
includePrivate
Returns
Array of string

◆ GetFieldValue()

static object Energy.Base.Class.GetFieldValue ( object  o,
string  name,
bool  includePrivate,
bool  ignoreCase 
)
static

Get field value of object.

Parameters
o
name
includePrivate
ignoreCase
Returns

◆ GetObjectsOfType()

static IEnumerable Energy.Base.Class.GetObjectsOfType ( IEnumerable  list,
Type  type 
)
static

Get list of objects of specified type from list.

Parameters
listList of objects
typeType to filter
Returns
List of filtered objects

◆ GetPropertyValue()

static object Energy.Base.Class.GetPropertyValue ( object  o,
string  name,
bool  includePrivate,
bool  ignoreCase,
object  index 
)
static

Get property value of object.

Parameters
o
name
includePrivate
ignoreCase
index
Returns

◆ GetTypes() [1/4]

static Type [] Energy.Base.Class.GetTypes ( Assembly []  assemblies,
TypeFilter  filter 
)
static

◆ GetTypes() [2/4]

static Type [] Energy.Base.Class.GetTypes ( Assembly []  assemblies)
static

◆ GetTypes() [3/4]

static Type [] Energy.Base.Class.GetTypes ( Assembly  assembly)
static

◆ GetTypes() [4/4]

static Type [] Energy.Base.Class.GetTypes ( Assembly  assembly,
TypeFilter  filter 
)
static

◆ GetValuesWithAttribute()

static object [] Energy.Base.Class.GetValuesWithAttribute ( object  item,
Type  attribute,
bool  includePrivate,
int  max 
)
static

Get values of all fields and properties of object with custom attribute.

Parameters
itemAny object
attributeAttribute class type
includePrivateInclude private fields and properties
maxMaximum number of fields
Returns
Value or null if not found

◆ GetValueWithAttribute()

static object Energy.Base.Class.GetValueWithAttribute ( object  o,
Type  attribute 
)
static

Get value of a first field or property of object with custom attribute.

Parameters
oAny object
attributeAttribute class type
Returns
Value or null if not found

◆ ObjectToStringArray()

static string [] Energy.Base.Class.ObjectToStringArray ( object  o,
bool  includePrivate,
bool  includeName 
)
static

Represent values of fields and properties of object as string array. If names should be included, array will be returned as a set of key and value pairs one by another.

Parameters
o
includePrivate
includeName
Returns

◆ TypeFilter()

delegate bool Energy.Base.Class.TypeFilter ( Type  type)

The documentation for this class was generated from the following file: