SoapServices.CodeXmlNamespaceForClrTypeNamespace(String, String) 方法

定义

从提供的命名空间和程序集名称返回公共语言运行时类型命名空间名称。

public:
 static System::String ^ CodeXmlNamespaceForClrTypeNamespace(System::String ^ typeNamespace, System::String ^ assemblyName);
public static string CodeXmlNamespaceForClrTypeNamespace(string typeNamespace, string assemblyName);
[System.Security.SecurityCritical]
public static string CodeXmlNamespaceForClrTypeNamespace(string typeNamespace, string assemblyName);
static member CodeXmlNamespaceForClrTypeNamespace : string * string -> string
[<System.Security.SecurityCritical>]
static member CodeXmlNamespaceForClrTypeNamespace : string * string -> string
Public Shared Function CodeXmlNamespaceForClrTypeNamespace (typeNamespace As String, assemblyName As String) As String

参数

typeNamespace
String

要编码的命名空间。

assemblyName
String

要编码的程序集的名称。

返回

提供的命名空间和程序集名称中的公共语言运行时类型命名空间名称。

属性

例外

参数assemblyNametypeNamespace既为空null,又为空。

即时调用方没有基础结构权限。

示例

下面的代码示例演示如何使用此方法。 该代码示例是 SoapServices 类中的一个较大示例的一部分。

// Convert a CLR namespace and assembly name into an XML namespace.
String^ xmlNamespace = SoapServices::CodeXmlNamespaceForClrTypeNamespace(
   L"ExampleNamespace", L"AssemblyName" );
Console::WriteLine( L"The name of the XML namespace is {0}.", xmlNamespace );
// Convert a CLR namespace and assembly name into an XML namespace.
string xmlNamespace = 
    SoapServices.CodeXmlNamespaceForClrTypeNamespace(
    "ExampleNamespace", "AssemblyName");
Console.WriteLine("The name of the XML namespace is {0}.", 
    xmlNamespace);

注解

.NET Framework 和 SoapSuds 工具使用当前方法为公共语言运行时对象类型创建 XML 命名空间名称。

适用于