C# 클래스 Microsoft.Silverlight.Testing.Harness.ReflectionUtility

A set of helper methods for interacting with methods and types that are marked with attributes.
파일 보기 프로젝트 열기: garyjohnson/wpnest

공개 메소드들

메소드 설명
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