SoapServices.IsClrTypeNamespace(String) 方法
定义
返回一个布尔值,该值指示指定的命名空间是否是公共语言运行时的本机命名空间。Returns a Boolean value that indicates whether the specified namespace is native to the common language runtime.
public:
static bool IsClrTypeNamespace(System::String ^ namespaceString);
public static bool IsClrTypeNamespace (string namespaceString);
static member IsClrTypeNamespace : string -> bool
Public Shared Function IsClrTypeNamespace (namespaceString As String) As Boolean
参数
- namespaceString
- String
要签入公共语言运行时的命名空间。The namespace to check in the common language runtime.
返回
如果给定的命名空间是公共语言运行时的本机命名空间,则为 true;否则为 false。true if the given namespace is native to the common language runtime; otherwise, false.
例外
直接调用方没有基础结构权限。The immediate caller does not have infrastructure permission.
示例
下面的代码示例演示如何使用此方法。The following code example shows how to use this method. 此代码示例是为类提供的更大示例的一部分 SoapServices 。This code example is part of a larger example provided for the SoapServices class.
// Determine whether an XML namespace represents a CLR namespace.
String^ clrNamespace = SoapServices::XmlNsForClrType;
if ( SoapServices::IsClrTypeNamespace( clrNamespace ) )
{
Console::WriteLine( L"The namespace {0} is a CLR namespace.",
clrNamespace );
}
else
{
Console::WriteLine( L"The namespace {0} is not a CLR namespace.",
clrNamespace );
}
// Determine whether an XML namespace represents a CLR namespace.
string clrNamespace = SoapServices.XmlNsForClrType;
if (SoapServices.IsClrTypeNamespace(clrNamespace))
{
Console.WriteLine(
"The namespace {0} is a CLR namespace.",
clrNamespace);
}
else
{
Console.WriteLine(
"The namespace {0} is not a CLR namespace.",
clrNamespace);
}
注解
SoapSuds 工具使用当前方法来确定 XML 命名空间是表示公共语言运行时类型还是非公共语言运行时系统中的类型。The current method is used by the SoapSuds tool to determine whether an XML namespace represents a common language runtime type or a type from a non-common language runtime system.
有关 SoapSuds 的详细信息,请参阅 SoapSuds 工具 (Soapsuds.exe) 。For more information about SoapSuds, see Soapsuds Tool (Soapsuds.exe).