Esempio n. 1
0
        /// <summary>Converts the specified <see cref="T:System.String" /> into a <see cref="T:System.Runtime.Remoting.Metadata.W3cXsd2001.SoapYearMonth" /> object.</summary>
        /// <returns>A <see cref="T:System.Runtime.Remoting.Metadata.W3cXsd2001.SoapYearMonth" /> object that is obtained from <paramref name="value" />.</returns>
        /// <param name="value">The <see cref="T:System.String" /> to convert </param>
        /// <exception cref="T:System.Runtime.Remoting.RemotingException">
        ///   <paramref name="value" /> does not contain a date and time that corresponds to any of the recognized format patterns. </exception>
        public static SoapYearMonth Parse(string value)
        {
            DateTime      value2        = DateTime.ParseExact(value, SoapYearMonth._datetimeFormats, null, DateTimeStyles.None);
            SoapYearMonth soapYearMonth = new SoapYearMonth(value2);

            if (value.StartsWith("-"))
            {
                soapYearMonth.Sign = -1;
            }
            else
            {
                soapYearMonth.Sign = 0;
            }
            return(soapYearMonth);
        }
        public static SoapYearMonth Parse(string value)
        {
            DateTime d = DateTime.ParseExact(value, _datetimeFormats, null, DateTimeStyles.None);

            SoapYearMonth res = new SoapYearMonth(d);

            if (value.StartsWith("-"))
            {
                res.Sign = -1;
            }
            else
            {
                res.Sign = 0;
            }
            return(res);
        }
Esempio n. 3
0
		public static SoapYearMonth Parse (string value)
		{
			DateTime d = DateTime.ParseExact (value, _datetimeFormats, null, DateTimeStyles.None);
			
			SoapYearMonth res = new SoapYearMonth (d);
			if (value.StartsWith ("-")) res.Sign = -1;
			else res.Sign = 0;
			return res;
		}