03.01.2015 Views

C# 5.0 Programmer's Reference

Visual Studio 2013 C# 5.0 Programmer's Reference

Visual Studio 2013 C# 5.0 Programmer's Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

XReflection<br />

A class’s type provides properties and methods that provide a wealth of information about the<br />

class. You can get a Type object representing a class by using typeof(TheClass) or by calling<br />

the GetType method on an instance of the class.<br />

The following section summarizes the Type class’s most useful properties and methods. The<br />

sections after that summarize other useful reflection classes.<br />

Type<br />

The following table lists the Type class’s most useful properties.<br />

Property<br />

Assembly<br />

Attributes<br />

BaseType<br />

ContainsGenericParameters<br />

CustomAttributes<br />

FullName<br />

IsAbstract<br />

IsArray<br />

IsAutoLayout<br />

Description<br />

Gets the assembly where the type is declared.<br />

Gets the type’s attributes.<br />

Gets the type’s parent class.<br />

Indicates whether the type has generic type parameters.<br />

Gets the type’s custom attributes.<br />

Gets the type’s fully qualified name, which includes the<br />

type’s namespace but not its assembly.<br />

Returns true if the type is abstract.<br />

Returns true if the type is an array.<br />

Returns true if the type’s fields are laid out automatically<br />

by the CLR.<br />

continues<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!