Share via


SoapYearMonth Classe

Definizione

Esegue il wrapping di un tipo gYearMonth XSD.

public ref class SoapYearMonth sealed : System::Runtime::Remoting::Metadata::W3cXsd2001::ISoapXsd
[System.Serializable]
public sealed class SoapYearMonth : System.Runtime.Remoting.Metadata.W3cXsd2001.ISoapXsd
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class SoapYearMonth : System.Runtime.Remoting.Metadata.W3cXsd2001.ISoapXsd
[<System.Serializable>]
type SoapYearMonth = class
    interface ISoapXsd
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type SoapYearMonth = class
    interface ISoapXsd
Public NotInheritable Class SoapYearMonth
Implements ISoapXsd
Ereditarietà
SoapYearMonth
Attributi
Implementazioni

Esempio

Nell'esempio di codice seguente viene illustrato l'uso della classe per eseguire il SoapYearMonth wrapping del tipo XSD gYearMonth .

using namespace System;
using namespace System::Runtime::Remoting::Metadata::W3cXsd2001;

int main()
{
   // Parse an XSD gYearMonth to create a SoapYearMonth object.
   // The timezone of this object is -08:00.
   String^ xsdYearMonth = "2003-11-08:00";
   SoapYearMonth^ yearMonth = SoapYearMonth::Parse( xsdYearMonth );

   // Display the yearMonth in XSD format. 
   Console::WriteLine( "The yearMonth in XSD format is {0}.",
      yearMonth );

   // Display the XSD type string of this particular SoapYearMonth object.
   Console::WriteLine( "The XSD type of the SoapYearMonth instance is {0}.",
      yearMonth->GetXsdType() );

   // Display the value of the SoapYearMonth object.
   Console::WriteLine( "The value of the SoapYearMonth instance is {0}.",
      yearMonth->Value );

   // Display the sign of the SoapYearMonth object.
   Console::WriteLine( "The sign of the SoapYearMonth instance is {0}.",
      yearMonth->Sign );

   // Display the XSD type string of the SoapYearMonth class.
   Console::WriteLine( "The XSD type of the class SoapYearMonth is {0}.",
      SoapYearMonth::XsdType );
}
using System;
using System.Runtime.Remoting.Metadata.W3cXsd2001;

public class Demo
{
    public static void Main(string[] args)
    {
        // Parse an XSD gYearMonth to create a SoapYearMonth object.
        // The time zone of this object is -08:00.
        string xsdYearMonth = "2003-11-08:00";
        SoapYearMonth yearMonth = SoapYearMonth.Parse(xsdYearMonth);

        // Display the yearMonth in XSD format. 
        Console.WriteLine("The yearMonth in XSD format is {0}.",
            yearMonth.ToString());

        // Display the XSD type string of this SoapYearMonth object.
        Console.WriteLine(
            "The XSD type of the SoapYearMonth object is {0}.",
            yearMonth.GetXsdType());

        // Display the value of the SoapYearMonth object.
        Console.WriteLine("The value of the SoapYearMonth object is {0}.",
            yearMonth.Value);

        // Display the sign of the SoapYearMonth object.
        Console.WriteLine("The sign of the SoapYearMonth object is {0}.",
            yearMonth.Sign);

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

Commenti

Per altre informazioni sui tipi di dati XSD, vedere Informazioni di riferimento sui tipi di dati XML.

Costruttori

SoapYearMonth()

Inizializza una nuova istanza della classe SoapYearMonth.

SoapYearMonth(DateTime)

Inizializza una nuova istanza della classe SoapYearMonth con un oggetto DateTime specificato.

SoapYearMonth(DateTime, Int32)

Inizializza una nuova istanza della classe SoapYearMonth con un oggetto DateTime specificato e un intero che indica se la proprietà Value è un valore positivo o negativo.

Proprietà

Sign

Ottiene o imposta un valore che indica se la data e l'ora dell'istanza corrente sono positive o negative.

Value

Ottiene o imposta la data e l'ora dell'istanza corrente.

XsdType

Ottiene il linguaggio XSD (XML Schema Definition) del tipo SOAP corrente.

Metodi

Equals(Object)

Determina se l'oggetto specificato è uguale all'oggetto corrente.

(Ereditato da Object)
GetHashCode()

Funge da funzione hash predefinita.

(Ereditato da Object)
GetType()

Ottiene l'oggetto Type dell'istanza corrente.

(Ereditato da Object)
GetXsdType()

Restituisce l'oggetto XML Schema Definition Language (XSD) del tipo SOAP corrente.

MemberwiseClone()

Crea una copia superficiale dell'oggetto Object corrente.

(Ereditato da Object)
Parse(String)

Converte l'oggetto String specificato in un oggetto SoapYearMonth.

ToString()

Restituisce una proprietà Value come String.

Si applica a