SoapTime Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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) | |
ToString() |
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈