| description | Learn more about: Platform::Type Class | ||
|---|---|---|---|
| title | Platform::Type Class | ||
| ms.date | 12/30/2016 | ||
| ms.topic | reference | ||
| f1_keywords |
|
||
| helpviewer_keywords |
|
||
| ms.assetid | d6b03f1e-b240-49b9-a08e-53a460030475 |
Contains run-time information about a type—specifically, a string name and a typecode. Obtained by calling Object::GetType on any object or using the typeid operator on a class or struct name.
public ref class Platform::Type :
Platform::Object, Platform::Details::IEquatable,
Platform::Details::IPrintableThe Type class is useful in applications that must direct processing by using an if or switch statement that branches based on the run-time type of an object. The type code that describes the category of a type is retrieved by using the Type::GetTypeCode member function.
| Name | Description |
|---|---|
| Type::GetTypeCode Method | Returns a Platform::TypeCode Enumeration value for the object. |
| Type::ToString Method | Returns the name of the type as specified in its metadata. |
| Name | Description |
|---|---|
| Type::FullName | Returns a Platform::String Class^ that represents the fully qualified name of the type, and uses . (dot) as a separator, not :: (double colon)—for example, MyNamespace.MyClass. |
| Name | Description |
|---|---|
| operator Type^ | Enables conversion from Windows::UI::Xaml::Interop::TypeName to Platform::Type. |
| operator Windows::UI::Xaml::Interop::TypeName | Enables conversion from Platform::Type to Windows::UI::Xaml::Interop::TypeName. |
Minimum supported client: Windows 8
Minimum supported server: Windows Server 2012
Namespace: Platform
Metadata: platform.winmd
Retrieves the fully-qualified name of the current type in the form Namespace.Type.
String^ FullName();The name of the type.
// namespace is TestApp
MainPage::MainPage()
{
InitializeComponent();
Type^ t = this->GetType();
auto s = t->FullName; // returns "TestApp.MainPage"
auto s2 = t->ToString(); //also returns "TestApp.MainPage"
}Retrieves a built-in types numerical type category.
Platform::TypeCode GetTypeCode();One of the Platform::TypeCode enumerated values.
The equivalent of the GetTypeCode() member method is the typeid property.
Retrieves the name of the type.
Platform::String^ ToString();A name of the type as specified in its metadata.