示例#1
0
    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);
    }
示例#2
0
文件: demo2.cs 项目: zhimaqiao51/docs
    static void Ctor3()
    {
        //<snippet23>
        // Create a SoapDate object with a positive sign.
        SoapDate date = new SoapDate(DateTime.Now, -1);

        Console.WriteLine("The date is {0}.", date.ToString());
        //</snippet23>
    }
示例#3
0
文件: demo2.cs 项目: zhimaqiao51/docs
    static void Ctor2()
    {
        //<snippet22>
        // Create a SoapDate object.
        SoapDate date = new SoapDate(DateTime.Now);

        Console.WriteLine("The date is {0}.", date.ToString());
        //</snippet22>
    }
示例#4
0
文件: demo2.cs 项目: zhimaqiao51/docs
    static void Ctor1()
    {
        //<snippet21>
        // Create a SoapDate object.
        SoapDate date = new SoapDate();

        date.Value = DateTime.Now;
        Console.WriteLine("The date is {0}.", date.ToString());
        //</snippet21>
    }