共用方式為


SoapQName 類別

定義

包裝 XSD QName 型別。

public ref class SoapQName sealed : System::Runtime::Remoting::Metadata::W3cXsd2001::ISoapXsd
[System.Serializable]
public sealed class SoapQName : System.Runtime.Remoting.Metadata.W3cXsd2001.ISoapXsd
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class SoapQName : System.Runtime.Remoting.Metadata.W3cXsd2001.ISoapXsd
[<System.Serializable>]
type SoapQName = class
    interface ISoapXsd
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type SoapQName = class
    interface ISoapXsd
Public NotInheritable Class SoapQName
Implements ISoapXsd
繼承
SoapQName
屬性
實作

範例

下列程式代碼範例示範如何使用 類別中的SoapQName成員,在物件與 XSD QName 字串之間SoapQName轉換。

#using <System.Runtime.Remoting.dll>
using namespace System;
using namespace System::Runtime::Remoting::Metadata::W3cXsd2001;

int main()
{
   // Parse an XSD formatted string to create a SoapQName object.
   String^ xsdQName = L"tns:SomeName";
   SoapQName^ qName = SoapQName::Parse( xsdQName );

   // Print the value of the SoapQName object in XSD format.
   Console::WriteLine( L"The SoapQName object in XSD format is {0}.", qName );

   // Print the XSD type string of the SoapQName object.
   Console::WriteLine( L"The XSD type of the SoapQName "
   L"object is {0}.", qName->GetXsdType() );

   // Print the XSD type string of the SoapQName class.
   Console::WriteLine( L"The XSD type of the SoapQName class "
   L"is {0}.", SoapQName::XsdType );

   // Create a QName object.
   SoapQName^ soapQNameInstance = gcnew SoapQName(
      L"tns",L"SomeName",L"http://example.org" );
   
   // Print the key the SoapQName object.
   Console::WriteLine( L"The key of the SoapQName object is {0}.",
      soapQNameInstance->Key );

   // Print the name of the SoapQName object.
   Console::WriteLine( L"The name of the SoapQName "
   L"object is {0}.", soapQNameInstance->Name );

   // Print the namespace of the SoapQName class.
   Console::WriteLine( L"The namespace for this instance of SoapQName is {0}.",
      soapQNameInstance->Namespace );
}
using System;
using System.Runtime.Remoting.Metadata.W3cXsd2001;

public class Demo
{
    public static void Main(string[] args)
    {
        // Parse an XSD formatted string to create a SoapQName object.
        string xsdQName = "tns:SomeName";
        SoapQName qName = SoapQName.Parse(xsdQName);

        // Print the value of the SoapQName object in XSD format.
        Console.WriteLine(
            "The SoapQName object in XSD format is {0}.",
            qName.ToString());

        // Print the XSD type string of the SoapQName object.
        Console.WriteLine("The XSD type of the SoapQName " +
            "object is {0}.", qName.GetXsdType());

        // Print the XSD type string of the SoapQName class.
        Console.WriteLine(
            "The XSD type of the SoapQName class " +
            "is {0}.", SoapQName.XsdType);

        // Create a QName object.
        SoapQName soapQNameInstance =
            new SoapQName("tns", "SomeName", "http://example.org");

        // Print the key the SoapQName object.
        Console.WriteLine("The key of the SoapQName " +
            "object is {0}.", soapQNameInstance.Key);

        // Print the name of the SoapQName object.
        Console.WriteLine("The name of the SoapQName " +
            "object is {0}.", soapQNameInstance.Name);

        // Print the namespace of the SoapQName class.
        Console.WriteLine("The namespace for this instance of SoapQName " +
            "is {0}.", soapQNameInstance.Namespace);
    }
}

備註

如需 XSD 資料類型的詳細資訊,請參閱 XML 數據類型參考

建構函式

SoapQName()

初始化 SoapQName 類別的新執行個體。

SoapQName(String)

使用限定名稱 (Qualified Name) 的本機部分,初始化 SoapQName 類別的新執行個體。

SoapQName(String, String)

使用限定名稱的命名空間別名和本機部分,初始化 SoapQName 類別的新執行個體。

SoapQName(String, String, String)

使用命名空間別名、限定名稱的本機部分和別名所參考的命名空間,初始化 SoapQName 類別的新執行個體。

屬性

Key

取得或設定限定名稱的命名空間別名。

Name

取得或設定限定名稱的名稱部分。

Namespace

取得或設定 Key 所參考的命名空間。

XsdType

取得目前 SOAP 型別的 XML 結構描述定義語言 (XSD)。

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
GetXsdType()

傳回目前 SOAP 型別的 XML 結構描述定義語言 (XSD)。

MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
Parse(String)

將指定的 String 轉換成 SoapQName 物件。

ToString()

傳回限定名稱做為 String

適用於