SoapServices.DecodeXmlNamespaceForClrTypeNamespace 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
從提供的通用語言執行時命名空間解碼 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
通用語言執行時命名空間。
傳回
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 命名空間中的自訂屬性中。 在設定檔中指定這些資訊有兩種方式:一是明確指定映射,二是指定要預載哪些物件類型。 目前的方法支援此類映射的檢索。