SuperMap.WindowsPhone.Core.Point2DCollectionConverter.ConvertFrom C# (CSharp) Méthode

ConvertFrom() public méthode

${WP_core_Point2DCollectionConverter_method_ConvertFrom_D}
public ConvertFrom ( ITypeDescriptorContext context, CultureInfo culture, object value ) : object
context ITypeDescriptorContext ${WP_core_Point2DCollectionConverter_method_ConvertFrom_param_context}
culture System.Globalization.CultureInfo ${WP_core_Point2DCollectionConverter_method_ConvertFrom_param_culture}
value object ${WP_core_Point2DCollectionConverter_method_ConvertFrom_param_value}
Résultat object
        public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
        {
            string str = value as string;
            if (str == null)
            {
                throw new NotSupportedException();
            }
            Point2DCollection points = new Point2DCollection();
            Point2DConverter converter = new Point2DConverter();
            int num = -1;
            for (int i = 0; i < (str.Length + 1); i++)
            {
                if ((i >= str.Length) || char.IsWhiteSpace(str[i]))
                {
                    int startIndex = num + 1;
                    int length = i - startIndex;
                    if (length >= 1)
                    {
                        string str2 = str.Substring(startIndex, length);
                        points.Add((Point2D)converter.ConvertFrom(str2));
                    }
                    num = i;
                }
            }
            return points;
        }
    }
Point2DCollectionConverter