C# Класс Microsoft.Silverlight.Testing.Harness.ReflectionUtility

A set of helper methods for interacting with methods and types that are marked with attributes.
Показать файл Открыть проект

Открытые методы

Метод Описание
GetAssemblies ( ) : IList

Returns a list of unique assemblies from a set of types.

GetAssembliesFromInstances ( IEnumerable objects ) : IList

Retrieve a list of Reflection.Assembly types from a set of instances and/or types.

GetAttribute ( ITestMethod method, Type decoratingAttribute ) : Attribute

Given a test method and a decorative attribute of interest, retrieves a single Attribute instance. Will throw an exception if multiple attributes exist on the method.

GetAttribute ( ITestMethod method, Type decoratingAttribute, bool inherit ) : Attribute

Given a test method and a decorative attribute of interest, retrieves a single Attribute instance. Will throw an exception if multiple attributes exist on the method.

GetAttribute ( MemberInfo member, Type decoratingAttribute ) : Attribute

Given a method and a decorative attribute of interest, retrieves a single Attribute instance. Will throw an exception if multiple attributes exist on the method.

GetAttributes ( ITestMethod method, Type decoratingAttribute, bool inherit ) : ICollection

Given a test method, returns the attributes (if any) that are of the decoratingAttribute parameter's type.

GetAttributes ( MemberInfo member, Type decoratingAttribute ) : ICollection

Given a MethodInfo type, returns the attributes (if any) that are of the decoratingAttribute parameter's type.

GetAttributes ( MemberInfo member, Type decoratingAttribute, bool inherit ) : ICollection

Given a MethodInfo type, returns the attributes (if any) that are of the decoratingAttribute parameter's type.

GetMethodsWithAttribute ( Type type, Type decoratingAttribute ) : ICollection

Return a collection of MethodInfo instances given a type to look through and the attribute of interest.

GetOneMethodWithAttribute ( Type type, Type decoratingAttribute ) : MethodInfo

Retrieve a MethodInfo from a single decorated method inside a type, if any. Throws an Exception if there are > 1 methods that are decorated with the attribute.

GetTypesWithAttribute ( Assembly assembly, Type decoratingAttribute ) : ICollection

Retrieve all types in an assembly that are decorated with a specific attribute.

HasAttribute ( ITestMethod method, Type decoratingAttribute ) : bool

Returns a value indicating whether a method has the attribute.

HasAttribute ( MemberInfo member, Type decoratingAttribute ) : bool

Returns a value indicating whether a method has the attribute.

Приватные методы

Метод Описание
GetAttribute ( ICollection attributes ) : Attribute

Given a list of attributes, retrieves a single Attribute instance. Will throw an exception if multiple attributes exist on the method.

Описание методов

GetAssemblies() публичный статический Метод

Returns a list of unique assemblies from a set of types.
public static GetAssemblies ( ) : IList
Результат IList

GetAssembliesFromInstances() публичный статический Метод

Retrieve a list of Reflection.Assembly types from a set of instances and/or types.
public static GetAssembliesFromInstances ( IEnumerable objects ) : IList
objects IEnumerable Set of instances or types.
Результат IList

GetAttribute() публичный статический Метод

Given a test method and a decorative attribute of interest, retrieves a single Attribute instance. Will throw an exception if multiple attributes exist on the method.
public static GetAttribute ( ITestMethod method, Type decoratingAttribute ) : Attribute
method ITestMethod ITestMethod instance.
decoratingAttribute System.Type /// Attribute type of interest. ///
Результат System.Attribute

GetAttribute() публичный статический Метод

Given a test method and a decorative attribute of interest, retrieves a single Attribute instance. Will throw an exception if multiple attributes exist on the method.
public static GetAttribute ( ITestMethod method, Type decoratingAttribute, bool inherit ) : Attribute
method ITestMethod ITestMethod instance.
decoratingAttribute System.Type /// Attribute type of interest. ///
inherit bool A value indicating whether to look for custom /// inherited attributes.
Результат System.Attribute

GetAttribute() публичный статический Метод

Given a method and a decorative attribute of interest, retrieves a single Attribute instance. Will throw an exception if multiple attributes exist on the method.
public static GetAttribute ( MemberInfo member, Type decoratingAttribute ) : Attribute
member System.Reflection.MemberInfo MemberInfo instance.
decoratingAttribute System.Type /// Attribute type of interest. ///
Результат System.Attribute

GetAttributes() публичный статический Метод

Given a test method, returns the attributes (if any) that are of the decoratingAttribute parameter's type.
public static GetAttributes ( ITestMethod method, Type decoratingAttribute, bool inherit ) : ICollection
method ITestMethod ITestMethod instance.
decoratingAttribute System.Type Attribute of interest.
inherit bool Whether to inherit attributes.
Результат ICollection

GetAttributes() публичный статический Метод

Given a MethodInfo type, returns the attributes (if any) that are of the decoratingAttribute parameter's type.
public static GetAttributes ( MemberInfo member, Type decoratingAttribute ) : ICollection
member System.Reflection.MemberInfo MemberInfo instance.
decoratingAttribute System.Type Attribute of interest.
Результат ICollection

GetAttributes() публичный статический Метод

Given a MethodInfo type, returns the attributes (if any) that are of the decoratingAttribute parameter's type.
public static GetAttributes ( MemberInfo member, Type decoratingAttribute, bool inherit ) : ICollection
member System.Reflection.MemberInfo MemberInfo instance.
decoratingAttribute System.Type Attribute of interest.
inherit bool A value indicating whether to look for /// inheriting custom attributes.
Результат ICollection

GetMethodsWithAttribute() публичный статический Метод

Return a collection of MethodInfo instances given a type to look through and the attribute of interest.
public static GetMethodsWithAttribute ( Type type, Type decoratingAttribute ) : ICollection
type System.Type Type to look through for methods.
decoratingAttribute System.Type Attribute of interest.
Результат ICollection

GetOneMethodWithAttribute() публичный статический Метод

Retrieve a MethodInfo from a single decorated method inside a type, if any. Throws an Exception if there are > 1 methods that are decorated with the attribute.
public static GetOneMethodWithAttribute ( Type type, Type decoratingAttribute ) : MethodInfo
type System.Type Type of interest.
decoratingAttribute System.Type Attribute of interest.
Результат System.Reflection.MethodInfo

GetTypesWithAttribute() публичный статический Метод

Retrieve all types in an assembly that are decorated with a specific attribute.
public static GetTypesWithAttribute ( Assembly assembly, Type decoratingAttribute ) : ICollection
assembly System.Reflection.Assembly Assembly to search.
decoratingAttribute System.Type /// Instance of the Type of attribute that marks interesting methods. ///
Результат ICollection

HasAttribute() публичный статический Метод

Returns a value indicating whether a method has the attribute.
public static HasAttribute ( ITestMethod method, Type decoratingAttribute ) : bool
method ITestMethod ITestMethod instance.
decoratingAttribute System.Type Attribute of interest.
Результат bool

HasAttribute() публичный статический Метод

Returns a value indicating whether a method has the attribute.
public static HasAttribute ( MemberInfo member, Type decoratingAttribute ) : bool
member System.Reflection.MemberInfo MemberInfo instance.
decoratingAttribute System.Type Attribute of interest.
Результат bool