C# Class Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Helpers.ReflectionHelper

Methods related to reflection.
Show file Open project: Azure/azure-iot-remote-monitoring

Public Methods

Method Description
GetNamedPropertyValue ( object item, string propertyName, bool usesCaseSensitivePropertyNameMatch, bool exceptionThrownIfNoMatch ) : object

Gets the value of an item's named property.

ProducePropertyValueExtractor ( string propertyName, bool usesCaseSensitivePropertyNameMatch, bool exceptionThrownIfNoMatch ) : dynamic>.Func

Produces a Func for extracting a named property's value from a dynamic-typed item.

SetNamedPropertyValue ( ICustomTypeDescriptor item, object newValue, string propertyName, bool usesCaseSensitivePropertyNameMatch, bool exceptionThrownIfNoMatch ) : void
SetNamedPropertyValue ( object item, object newValue, string propertyName, bool usesCaseSensitivePropertyNameMatch, bool exceptionThrownIfNoMatch ) : void

Sets a named property's value.

ToKeyValuePairs ( this item ) : object>>.IEnumerable

Gets an IDynamicMetaObjectProvider implementation's properties and their values as an IEnumerable>.

Private Methods

Method Description
GetNamedPropertyValue ( ICustomTypeDescriptor item, string propertyName, bool usesCaseSensitivePropertyNameMatch, bool exceptionThrownIfNoMatch ) : object

Gets the value of an ICustomTypeDescriptor implementation's named property.

GetNamedPropertyValue ( IDynamicMetaObjectProvider item, string propertyName, bool usesCaseSensitivePropertyNameMatch, bool exceptionThrownIfNoMatch ) : object

Gets the value of an IDynamicMetaObjectProvider implementation's named property.

ProduceGetMethodExtractor ( string propertyName, bool usesCaseSensitivePropertyNameMatch ) : MethodInfo>.Func
ToKeyValuePairImpl ( this item ) : object>>.IEnumerable

Method Details

GetNamedPropertyValue() public static method

Gets the value of an item's named property.
public static GetNamedPropertyValue ( object item, string propertyName, bool usesCaseSensitivePropertyNameMatch, bool exceptionThrownIfNoMatch ) : object
item object /// The item from which to extract a named property's value. ///
propertyName string /// The name of the property. ///
usesCaseSensitivePropertyNameMatch bool /// A value indicating whether the property name match should be /// case-sensitive. ///
exceptionThrownIfNoMatch bool /// A value indicating whether an exception should be thrown if /// no matching property can be found. ///
return object

ProducePropertyValueExtractor() public static method

Produces a Func for extracting a named property's value from a dynamic-typed item.
public static ProducePropertyValueExtractor ( string propertyName, bool usesCaseSensitivePropertyNameMatch, bool exceptionThrownIfNoMatch ) : dynamic>.Func
propertyName string /// The name of the property. ///
usesCaseSensitivePropertyNameMatch bool /// A value indicating wether the property name match should be /// case-sensitive. ///
exceptionThrownIfNoMatch bool /// A value indicating whether the produced /// Func should throw an /// ArgumentException if no matching property can be /// found on the current item. ///
return dynamic>.Func

SetNamedPropertyValue() public static method

public static SetNamedPropertyValue ( ICustomTypeDescriptor item, object newValue, string propertyName, bool usesCaseSensitivePropertyNameMatch, bool exceptionThrownIfNoMatch ) : void
item ICustomTypeDescriptor
newValue object
propertyName string
usesCaseSensitivePropertyNameMatch bool
exceptionThrownIfNoMatch bool
return void

SetNamedPropertyValue() public static method

Sets a named property's value.
public static SetNamedPropertyValue ( object item, object newValue, string propertyName, bool usesCaseSensitivePropertyNameMatch, bool exceptionThrownIfNoMatch ) : void
item object /// The ICustomTypeDescriptor implementation on which /// to set a named property's value. ///
newValue object /// The value to assign to the named property. ///
propertyName string /// The name of the property to set. ///
usesCaseSensitivePropertyNameMatch bool /// A value indicating whether the property name matching should be /// case-sensitive. ///
exceptionThrownIfNoMatch bool /// A value indicating whether an ArgumentException /// should be thrown if no matching property can be found. ///
return void

ToKeyValuePairs() public static method

Gets an IDynamicMetaObjectProvider implementation's properties and their values as an IEnumerable>.
public static ToKeyValuePairs ( this item ) : object>>.IEnumerable
item this /// The IDynamicMetaObjectProvider implementation. ///
return object>>.IEnumerable