共用方式為


ApiInformation.IsTypePresent(String) 方法

定義

傳回 true 或 false,指出指定的型別是否存在。

public:
 static bool IsTypePresent(Platform::String ^ typeName);
 static bool IsTypePresent(winrt::hstring const& typeName);
public static bool IsTypePresent(string typeName);
function isTypePresent(typeName)
Public Shared Function IsTypePresent (typeName As String) As Boolean

參數

typeName
String

Platform::String

winrt::hstring

型別的命名空間限定名稱。

傳回

Boolean

bool

如果 指定的型別存在,則為 True;否則為 false

範例

if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.System.AppDiagnosticInfo"))
{
    Debug.WriteLine("Windows.System.AppDiagnosticInfo type was found");
}
else
{
    Debug.WriteLine("Windows.System.AppDiagnosticInfo type was NOT found");
}

適用於