SoapDate Clase
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Ajusta un tipo XSD date
.
public ref class SoapDate sealed : System::Runtime::Remoting::Metadata::W3cXsd2001::ISoapXsd
[System.Serializable]
public sealed class SoapDate : System.Runtime.Remoting.Metadata.W3cXsd2001.ISoapXsd
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class SoapDate : System.Runtime.Remoting.Metadata.W3cXsd2001.ISoapXsd
[<System.Serializable>]
type SoapDate = class
interface ISoapXsd
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type SoapDate = class
interface ISoapXsd
Public NotInheritable Class SoapDate
Implements ISoapXsd
- Herencia
-
SoapDate
- Atributos
- Implementaciones
Ejemplos
En el ejemplo de código siguiente se muestra cómo usar la SoapDate clase para encapsular un tipo XML date
.
using namespace System;
using namespace System::Runtime::Remoting::Metadata::W3cXsd2001;
int main()
{
// Parse an XSD date to create a SoapDate object.
String^ xsdDate = "2003-02-04";
SoapDate^ date = SoapDate::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 SoapDate object.
Console::WriteLine( "The XSD type of the SoapDate instance is {0}.",
date->GetXsdType() );
// Print out the value of the SoapDate object.
Console::WriteLine( "The value of the SoapDate instance is {0}.",
date->Value );
// Print out the sign of the SoapDate object.
Console::WriteLine( "The sign of the SoapDate instance is {0}.",
date->Sign );
// Print out the XSD type string of the SoapDate class.
Console::WriteLine( "The XSD type of SoapDate is {0}.",
SoapDate::XsdType );
}
using System;
using System.Runtime.Remoting.Metadata.W3cXsd2001;
public class Demo
{
public static void Main(string[] args)
{
// Parse an XSD date to create a SoapDate object.
string xsdDate = "2003-02-04";
SoapDate date = SoapDate.Parse(xsdDate);
// Serialize a DateTime object as an XSD date string.
Console.WriteLine("The date in XSD format is {0}.",
date.ToString());
// Print the XSD type string of this particular SoapDate object.
Console.WriteLine("The XSD type of the SoapDate object is {0}.",
date.GetXsdType());
// Print the value of the SoapDate object.
Console.WriteLine("The value of the SoapDate object is {0}.",
date.Value);
// Print the sign of the SoapDate object.
Console.WriteLine("The sign of the SoapDate object is {0}.",
date.Sign);
// Print the XSD type string of the SoapDate class.
Console.WriteLine("The XSD type of SoapDate is {0}.",
SoapDate.XsdType);
}
}
Comentarios
Para obtener más información sobre los tipos de datos XSD, vea la Referencia de tipos de datos XML.
Constructores
SoapDate() |
Inicializa una nueva instancia de la clase SoapDate. |
SoapDate(DateTime) |
Inicializa una nueva instancia de la clase SoapDate con el objeto DateTime especificado. |
SoapDate(DateTime, Int32) |
Inicializa una nueva instancia de la clase SoapDate 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 SoapDate. |
ToString() |