SoapDate 构造函数

定义

初始化 SoapDate 类的新实例。Initializes a new instance of the SoapDate class.

重载

SoapDate()

初始化 SoapDate 类的新实例。Initializes a new instance of the SoapDate class.

SoapDate(DateTime)

用指定的 SoapDate 对象初始化 DateTime 类的新实例。Initializes a new instance of the SoapDate class with a specified DateTime object.

SoapDate(DateTime, Int32)

用指定的 SoapDate 对象和一个指示 DateTime 是正值还是负值的整数初始化 Value 类的新实例。Initializes a new instance of the SoapDate class with a specified DateTime object and an integer that indicates whether Value is a positive or negative value.

SoapDate()

初始化 SoapDate 类的新实例。Initializes a new instance of the SoapDate class.

public:
 SoapDate();
public SoapDate ();
Public Sub New ()

示例

下面的代码示例演示如何使用此构造函数。The following code example shows how to use this constructor.

// Create a SoapDate object.
SoapDate^ date = gcnew SoapDate;
date->Value = DateTime::Now;
Console::WriteLine( "The date is {0}.", date );
// Create a SoapDate object.
SoapDate date = new SoapDate();
date.Value = DateTime.Now;
Console.WriteLine("The date is {0}.", date.ToString());

适用于

SoapDate(DateTime)

用指定的 SoapDate 对象初始化 DateTime 类的新实例。Initializes a new instance of the SoapDate class with a specified DateTime object.

public:
 SoapDate(DateTime value);
public SoapDate (DateTime value);
new System.Runtime.Remoting.Metadata.W3cXsd2001.SoapDate : DateTime -> System.Runtime.Remoting.Metadata.W3cXsd2001.SoapDate
Public Sub New (value As DateTime)

参数

value
DateTime

用于初始化当前实例的 DateTime 对象。A DateTime object to initialize the current instance.

示例

下面的代码示例演示如何使用此构造函数。The following code example shows how to use this constructor.

// Create a SoapDate object.
SoapDate^ date = gcnew SoapDate( DateTime::Now );
Console::WriteLine( "The date is {0}.", date );
// Create a SoapDate object.
SoapDate date = new SoapDate(DateTime.Now);
Console.WriteLine("The date is {0}.", date.ToString());

适用于

SoapDate(DateTime, Int32)

用指定的 SoapDate 对象和一个指示 DateTime 是正值还是负值的整数初始化 Value 类的新实例。Initializes a new instance of the SoapDate class with a specified DateTime object and an integer that indicates whether Value is a positive or negative value.

public:
 SoapDate(DateTime value, int sign);
public SoapDate (DateTime value, int sign);
new System.Runtime.Remoting.Metadata.W3cXsd2001.SoapDate : DateTime * int -> System.Runtime.Remoting.Metadata.W3cXsd2001.SoapDate
Public Sub New (value As DateTime, sign As Integer)

参数

value
DateTime

用于初始化当前实例的 DateTime 对象。A DateTime object to initialize the current instance.

sign
Int32

一个整数,指示 value 是否为正。An integer that indicates whether value is positive.

示例

下面的代码示例演示如何使用此构造函数。The following code example shows how to use this constructor.

// Create a SoapDate object with a positive sign.
SoapDate^ date = gcnew SoapDate( DateTime::Now,1 );
Console::WriteLine( "The date is {0}.", date );
// Create a SoapDate object with a positive sign.
SoapDate date = new SoapDate(DateTime.Now, -1);
Console.WriteLine("The date is {0}.", date.ToString());

注解

小于0的整数指示为负 signAn integer of less than 0 indicates a negative sign.

适用于