Show / Hide Table of Contents

Class ReflectionExtensions

Inheritance
System.Object
ReflectionExtensions
Namespace:InfinniPlatform.Dynamic
Assembly:InfinniPlatform.Core.Abstractions.dll
Syntax
public static class ReflectionExtensions : object

Methods

| Improve this Doc View Source

CanInvoke(MethodInfo, Object[], out Object[], Type[])

Определяет, можно ли вызвать метод с заданными параметрами.

Declaration
public static bool CanInvoke(this MethodInfo target, object[] arguments, out object[] resultArguments, Type[] genericParameters = null)
Parameters
Type Name Description
MethodInfo target
System.Object[] arguments
System.Object[] resultArguments
Type[] genericParameters
Returns
Type Description
System.Boolean
| Improve this Doc View Source

FastDynamicInvoke(Delegate, Object[])

Представляет метод быстрого вызова делегата.

Declaration
public static object FastDynamicInvoke(this Delegate target, params object[] args)
Parameters
Type Name Description
Delegate target
System.Object[] args
Returns
Type Description
System.Object
| Improve this Doc View Source

FindMember(Type, String, Func<MemberInfo, Boolean>, BindingFlags)

Осуществляет поиск члена с заданным именем.

Declaration
public static MemberInfo FindMember(this Type target, string memberName, Func<MemberInfo, bool> memberFilter = null, BindingFlags bindingFlags = null)
Parameters
Type Name Description
Type target
System.String memberName
Func<MemberInfo, System.Boolean> memberFilter
BindingFlags bindingFlags
Returns
Type Description
MemberInfo
| Improve this Doc View Source

GetAttributeValue<TAttribute, TResult>(ICustomAttributeProvider, Func<TAttribute, TResult>, TResult)

Возвращает значение атрибута.

Declaration
public static TResult GetAttributeValue<TAttribute, TResult>(this ICustomAttributeProvider target, Func<TAttribute, TResult> valueSelector, TResult defaultValue = null)where TAttribute : Attribute
Parameters
Type Name Description
ICustomAttributeProvider target

Источник для поиска атрибута.

Func<TAttribute, TResult> valueSelector

Метод выборки значения атрибута.

TResult defaultValue

Значение атрибута по умолчанию.

Returns
Type Description
TResult

Значение атрибута.

Type Parameters
Name Description
TAttribute

Тип атрибута.

TResult

Тип значения.

| Improve this Doc View Source

GetDefaultValue(Type)

Возвращает значение по умолчанию для заданного типа.

Declaration
public static object GetDefaultValue(this Type target)
Parameters
Type Name Description
Type target
Returns
Type Description
System.Object
| Improve this Doc View Source

GetEventDelegate(Object, EventInfo)

Возвращает делегат для вызова обработчика события с заданным именем.

Declaration
public static Delegate GetEventDelegate(this object target, EventInfo memberInfo)
Parameters
Type Name Description
System.Object target
EventInfo memberInfo
Returns
Type Description
Delegate
| Improve this Doc View Source

GetFieldValue(Object, FieldInfo)

Возвращает значение поля с заданным именем.

Declaration
public static object GetFieldValue(this object target, FieldInfo memberInfo)
Parameters
Type Name Description
System.Object target
FieldInfo memberInfo
Returns
Type Description
System.Object
| Improve this Doc View Source

GetMemberValue(Object, String)

Возвращает значение члена с заданным именем.

Declaration
public static object GetMemberValue(this object target, string memberName)
Parameters
Type Name Description
System.Object target
System.String memberName
Returns
Type Description
System.Object
| Improve this Doc View Source

GetMemberValue(Type, String)

Возвращает значение статического члена с заданным именем.

Declaration
public static object GetMemberValue(this Type target, string memberName)
Parameters
Type Name Description
Type target
System.String memberName
Returns
Type Description
System.Object
| Improve this Doc View Source

GetMethodDelegate(Object, MethodInfo)

Возвращает делегат для вызова метода с заданным именем.

Declaration
public static Delegate GetMethodDelegate(this object target, MethodInfo memberInfo)
Parameters
Type Name Description
System.Object target
MethodInfo memberInfo
Returns
Type Description
Delegate
| Improve this Doc View Source

GetPropertyValue(Object, PropertyInfo)

Возвращает значение свойства с заданным именем.

Declaration
public static object GetPropertyValue(this object target, PropertyInfo memberInfo)
Parameters
Type Name Description
System.Object target
PropertyInfo memberInfo
Returns
Type Description
System.Object
| Improve this Doc View Source

InvokeMember(Object, String, Object[], out Object, Type[])

Интерпретирует значение члена с заданным именем как делегат и вызывает его.

Declaration
public static bool InvokeMember(this object target, string memberName, object[] invokeArguments, out object invokeResult, Type[] genericParameters = null)
Parameters
Type Name Description
System.Object target
System.String memberName
System.Object[] invokeArguments
System.Object invokeResult
Type[] genericParameters
Returns
Type Description
System.Boolean
| Improve this Doc View Source

InvokeMember(Type, String, Object[], out Object, Type[])

Интерпретирует значение статического члена с заданным именем как делегат и вызывает его.

Declaration
public static bool InvokeMember(this Type target, string memberName, object[] invokeArguments, out object invokeResult, Type[] genericParameters = null)
Parameters
Type Name Description
Type target
System.String memberName
System.Object[] invokeArguments
System.Object invokeResult
Type[] genericParameters
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsInstanceOfType(Object, Type)

Определяет, является ли объект экземпляром заданного типа.

Declaration
public static bool IsInstanceOfType(this object target, Type type)
Parameters
Type Name Description
System.Object target
Type type
Returns
Type Description
System.Boolean
| Improve this Doc View Source

NameOf(Type)

Возвращает имя типа.

Declaration
public static string NameOf(this Type target)
Parameters
Type Name Description
Type target
Returns
Type Description
System.String
| Improve this Doc View Source

SetEventDelegate(Object, EventInfo, Object)

Устанавливает делегат для вызова обработчика события с заданным именем.

Declaration
public static bool SetEventDelegate(this object target, EventInfo memberInfo, object memberValue)
Parameters
Type Name Description
System.Object target
EventInfo memberInfo
System.Object memberValue
Returns
Type Description
System.Boolean
| Improve this Doc View Source

SetFieldValue(Object, FieldInfo, Object)

Устанавливает значение поля с заданным именем.

Declaration
public static bool SetFieldValue(this object target, FieldInfo memberInfo, object memberValue)
Parameters
Type Name Description
System.Object target
FieldInfo memberInfo
System.Object memberValue
Returns
Type Description
System.Boolean
| Improve this Doc View Source

SetMemberValue(Object, String, Object)

Устанавливает значение члена с заданным именем.

Declaration
public static bool SetMemberValue(this object target, string memberName, object memberValue)
Parameters
Type Name Description
System.Object target
System.String memberName
System.Object memberValue
Returns
Type Description
System.Boolean
| Improve this Doc View Source

SetMemberValue(Type, String, Object)

Устанавливает значение статического члена с заданным именем.

Declaration
public static bool SetMemberValue(this Type target, string memberName, object memberValue)
Parameters
Type Name Description
Type target
System.String memberName
System.Object memberValue
Returns
Type Description
System.Boolean
| Improve this Doc View Source

SetPropertyValue(Object, PropertyInfo, Object)

Устанавливает значение свойства с заданным именем.

Declaration
public static bool SetPropertyValue(this object target, PropertyInfo memberInfo, object memberValue)
Parameters
Type Name Description
System.Object target
PropertyInfo memberInfo
System.Object memberValue
Returns
Type Description
System.Boolean
  • Improve this Doc
  • View Source
Back to top © Copyright Infinnity Solutions Ltd, 2010–2017.