Пример #1
0
 /// <summary>
 /// Parses the size from a string.
 /// </summary>
 public static XSize Parse(string source)
 {
   XSize empty;
   CultureInfo cultureInfo = CultureInfo.InvariantCulture;
   TokenizerHelper helper = new TokenizerHelper(source, cultureInfo);
   string str = helper.NextTokenRequired();
   if (str == "Empty")
     empty = Empty;
   else
     empty = new XSize(Convert.ToDouble(str, cultureInfo), Convert.ToDouble(helper.NextTokenRequired(), cultureInfo));
   helper.LastTokenRequired();
   return empty;
 }
Пример #2
0
 /// <summary>
 /// Parses a matrix from a string.
 /// </summary>
 public static XMatrix Parse(string source)
 {
   XMatrix identity;
   IFormatProvider cultureInfo = CultureInfo.InvariantCulture; //.GetCultureInfo("en-us");
   TokenizerHelper helper = new TokenizerHelper(source, cultureInfo);
   string str = helper.NextTokenRequired();
   identity = str == "Identity" ? Identity : 
     new XMatrix(Convert.ToDouble(str, cultureInfo), Convert.ToDouble(helper.NextTokenRequired(), cultureInfo), Convert.ToDouble(helper.NextTokenRequired(), cultureInfo), Convert.ToDouble(helper.NextTokenRequired(), cultureInfo), Convert.ToDouble(helper.NextTokenRequired(), cultureInfo), Convert.ToDouble(helper.NextTokenRequired(), cultureInfo));
   helper.LastTokenRequired();
   return identity;
 }
Пример #3
0
 /// <summary>
 /// Parses the point from a string.
 /// </summary>
 public static XPoint Parse(string source)
 {
   CultureInfo cultureInfo = CultureInfo.InvariantCulture;
   TokenizerHelper helper = new TokenizerHelper(source, cultureInfo);
   string str = helper.NextTokenRequired();
   XPoint point = new XPoint(Convert.ToDouble(str, cultureInfo), Convert.ToDouble(helper.NextTokenRequired(), cultureInfo));
   helper.LastTokenRequired();
   return point;
 }
Пример #4
0
 public static XVector Parse(string source)
 {
     TokenizerHelper helper = new TokenizerHelper(source, CultureInfo.InvariantCulture);
     string str = helper.NextTokenRequired();
     XVector vector = new XVector(Convert.ToDouble(str, CultureInfo.InvariantCulture), Convert.ToDouble(helper.NextTokenRequired(), CultureInfo.InvariantCulture));
     helper.LastTokenRequired();
     return vector;
 }