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");
}

适用于