語言

SoapServices.DecodeXmlNamespaceForClrTypeNamespace 方法

定義

從提供的通用語言執行時命名空間解碼 XML 命名空間與組合名稱。

public:
 static bool DecodeXmlNamespaceForClrTypeNamespace(System::String ^ inNamespace, [Runtime::InteropServices::Out] System::String ^ % typeNamespace, [Runtime::InteropServices::Out] System::String ^ % assemblyName);
public static bool DecodeXmlNamespaceForClrTypeNamespace(string inNamespace, out string typeNamespace, out string assemblyName);
[System.Security.SecurityCritical]
public static bool DecodeXmlNamespaceForClrTypeNamespace(string inNamespace, out string typeNamespace, out string assemblyName);
static member DecodeXmlNamespaceForClrTypeNamespace : string * string * string -> bool
[<System.Security.SecurityCritical>]
static member DecodeXmlNamespaceForClrTypeNamespace : string * string * string -> bool
Public Shared Function DecodeXmlNamespaceForClrTypeNamespace (inNamespace As String, ByRef typeNamespace As String, ByRef assemblyName As String) As Boolean

參數

inNamespace
String

通用語言執行時命名空間。

typeNamespace
String

當此方法回傳時,包含 String 一個,該名稱儲存了解碼後的命名空間名稱。 這個參數會未初始化傳遞。

assemblyName
String

當此方法回傳時,包含 String 包含已解碼的組合名稱。 這個參數會未初始化傳遞。

傳回

true若命名空間與組合語言名稱成功解碼;否則,。 false

屬性

例外狀況

inNamespace參數為 null 或 為空。

直接呼叫者沒有基礎設施權限。

範例

以下程式碼範例展示了如何使用此方法。 此程式碼範例是本類別更大範例 SoapServices 的一部分。

// Extract a CLR namespace and assembly name from an XML namespace.
String^ typeNamespace;
String^ assemblyName;
SoapServices::DecodeXmlNamespaceForClrTypeNamespace(
   xmlNamespace,typeNamespace,assemblyName );
Console::WriteLine( L"The name of the CLR namespace is {0}.", typeNamespace );
Console::WriteLine( L"The name of the CLR assembly is {0}.", assemblyName );
// Extract a CLR namespace and assembly name from an XML namespace.
string typeNamespace;
string assemblyName;
SoapServices.DecodeXmlNamespaceForClrTypeNamespace(xmlNamespace,
    out typeNamespace, out assemblyName);
Console.WriteLine("The name of the CLR namespace is {0}.", 
    typeNamespace);
Console.WriteLine("The name of the CLR assembly is {0}.", 
    assemblyName);

備註

當 .NET Framework 解析 XML 串流時,它需要知道如何將串流讀取的 XML 轉換成通用的執行時語言類型。 指定 .NET Framework 如何產生與解析 XML 串流的資訊,儲存在位於 System.Runtime.Remoting.Metadata 命名空間中的自訂屬性中。 在設定檔中指定這些資訊有兩種方式:一是明確指定映射,二是指定要預載哪些物件類型。 目前的方法支援此類映射的檢索。

適用於