SoapYear Clase

Definición

Ajusta un tipo XSD gYear.

public ref class SoapYear sealed : System::Runtime::Remoting::Metadata::W3cXsd2001::ISoapXsd
[System.Serializable]
public sealed class SoapYear : System.Runtime.Remoting.Metadata.W3cXsd2001.ISoapXsd
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class SoapYear : System.Runtime.Remoting.Metadata.W3cXsd2001.ISoapXsd
[<System.Serializable>]
type SoapYear = class
    interface ISoapXsd
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type SoapYear = class
    interface ISoapXsd
Public NotInheritable Class SoapYear
Implements ISoapXsd
Herencia
SoapYear
Atributos
Implementaciones

Ejemplos

En el ejemplo de código siguiente se muestra el uso de la SoapYear clase para encapsular el tipo XSD gYear .

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

int main()
{
   // Parse an XSD date to create a SoapYear object.
   String^ xsdDate = "2003";
   SoapYear^ date = SoapYear::Parse( xsdDate );

   // Serialize a DateTime object as an XSD date string.
   Console::WriteLine( "The date in XSD format is {0}.",
      date );

   // Print out the XSD type string of this particular SoapYear object.
   Console::WriteLine( "The XSD type of the SoapYear instance is {0}.",
      date->GetXsdType() );

   // Print out the value of the SoapYear object.
   Console::WriteLine( "The value of the SoapYear instance is {0}.",
      date->Value );

   // Print out the sign of the SoapYear object.
   Console::WriteLine( "The sign of the SoapYear instance is {0}.",
      date->Sign );

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

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

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

        // Print the XSD type string of this particular SoapYear object.
        Console.WriteLine("The XSD type of the SoapYear object is {0}.",
            year.GetXsdType());

        // Print the value of the SoapYear object.
        Console.WriteLine("The value of the SoapYear object is {0}.",
            year.Value);

        // Print the sign of the SoapYear object.
        Console.WriteLine("The sign of the SoapYear object is {0}.",
            year.Sign);

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

Comentarios

Para obtener más información sobre los tipos de datos XSD, vea Referencia de tipos de datos XML.

Constructores

SoapYear()

Inicializa una nueva instancia de la clase SoapYear.

SoapYear(DateTime)

Inicializa una nueva instancia de la clase SoapYear con el objeto DateTime especificado.

SoapYear(DateTime, Int32)

Inicializa una nueva instancia de la clase SoapYear con el objeto DateTime especificado y un entero que indica si Value es un valor positivo o negativo.

Propiedades

Sign

Obtiene o establece si la fecha y la hora de la instancia actual es positiva o negativa.

Value

Obtiene o establece la fecha y la hora de la instancia actual.

XsdType

Obtiene el lenguaje de definición de esquemas XML (XSD) del tipo SOAP actual.

Métodos

Equals(Object)

Determina si el objeto especificado es igual que el objeto actual.

(Heredado de Object)
GetHashCode()

Sirve como la función hash predeterminada.

(Heredado de Object)
GetType()

Obtiene el Type de la instancia actual.

(Heredado de Object)
GetXsdType()

Devuelve el lenguaje de definición de esquemas XML (XSD) del tipo SOAP actual.

MemberwiseClone()

Crea una copia superficial del Object actual.

(Heredado de Object)
Parse(String)

Convierte el objeto String especificado en un objeto SoapYear.

ToString()

Devuelve un parámetro Value como clase String.

Se aplica a