public static void Main(string[] args) { // Parse an XSD gYear to create a SoapYear object. // The time zone of this object is -08:00. string xsdYear = "2003-08:00"; SoapYear year = SoapYear.Parse(xsdYear); // Print the year in XSD format. Console.WriteLine("The year in XSD format is {0}.", year.ToString()); // Print the XSD type string of this particular SoapYear object. Console.WriteLine("The XSD type of the SoapYear object is {0}.", year.GetXsdType()); // Print the value of the SoapYear object. Console.WriteLine("The value of the SoapYear object is {0}.", year.Value); // Print the sign of the SoapYear object. Console.WriteLine("The sign of the SoapYear object is {0}.", year.Sign); // Print the XSD type string of the SoapYear class. Console.WriteLine("The XSD type of the class SoapYear is {0}.", SoapYear.XsdType); }
static void Ctor3() { //<snippet23> // Create a SoapYear object with a positive sign. SoapYear year = new SoapYear(DateTime.Now, 1); Console.WriteLine("The year is {0}.", year.ToString()); //</snippet23> }
static void Ctor2() { //<snippet22> // Create a SoapYear object. SoapYear year = new SoapYear(DateTime.Now); Console.WriteLine("The year is {0}.", year.ToString()); //</snippet22> }
static void Ctor1() { //<snippet21> // Create a SoapYear object. SoapYear year = new SoapYear(); year.Value = DateTime.Now; Console.WriteLine("The year is {0}.", year.ToString()); //</snippet21> }