Edit

Share via


SoapTime Class

Definition

Wraps an XSD time type.

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

Examples

The following code example demonstrates using the SoapTime class to wrap an XSD time type.

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

int main()
{
   // Parse an XSD gTime to create a SoapTime object.
   // The timezone of this object is the current timezone.
   String^ xsdTime = "12:13:14.123Z";
   SoapTime^ time = SoapTime::Parse( xsdTime );

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

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

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

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

public class Demo
{
    public static void Main(string[] args)
    {
        // Parse an XSD gTime to create a SoapTime object.
        // The time zone of this object is the current time zone.
        string xsdTime = "12:13:14.123Z";
        SoapTime time = SoapTime.Parse(xsdTime);

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

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

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

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

Remarks

For more information about XSD data types, see XML Data Types Reference.

Constructors

SoapTime()

Initializes a new instance of the SoapTime class.

SoapTime(DateTime)

Initializes a new instance of the SoapTime class with a specified DateTime object.

Properties

Value

Gets or sets the date and time of the current instance.

XsdType

Gets the XML Schema definition language (XSD) of the current SOAP type.

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
GetXsdType()

Returns the XML Schema definition language (XSD) of the current SOAP type.

MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
Parse(String)

Converts the specified String into a SoapTime object.

ToString()

Returns Value as a String.

Applies to