SuperMap.WindowsPhone.Core.Rectangle2DConverter.converFromString C# (CSharp) Method

converFromString() private static method

private static converFromString ( string text ) : object
text string
return object
        private static object converFromString(string text)
        {
            if (text == null)
            {
                return null;
            }
            string str = text.Trim();
            if (str.Length == 0)
            {
                return null;
            }
            CultureInfo invariantCulture = CultureInfo.InvariantCulture;
            char ch = invariantCulture.TextInfo.ListSeparator[0];
            string[] strArray = str.Split(new char[] { ch });
            double[] doubleArray = new double[strArray.Length];
            //TODO:
            if (doubleArray.Length != 4)
            {
                return null;
            }

            for (int i = 0; i < strArray.Length; i++)
            {
                doubleArray[i] = double.Parse(strArray[i], invariantCulture);
            }
            //if (doubleArray.Length != 4)
            //{
            //    throw new ArgumentException(ExceptionStrings.TextParseFailed, "Left,Bottom,Right,Top");
            //}

            return new Rectangle2D(doubleArray[0], doubleArray[1], doubleArray[2], doubleArray[3]);
        }