private bool TryReadEnvelope(string value, out object result) { if (!_shapeConverter.CanConvert(ObjectType.Envelope)) { result = null; return(false); } var match = Regex.Match(value, @"^ \s* (-?\d+.\d+?) \s+ (-?\d+.\d+?) \s+ (-?\d+.\d+?) \s+ (-?\d+.\d+?) \s* $", RegexOptions.IgnorePatternWhitespace | RegexOptions.IgnoreCase); if (match.Success) { result = _shapeConverter.ToEnvelope(new [] { new CoordinateInfo { X = double.Parse(match.Groups[1].Value, CultureInfo.InvariantCulture), Y = double.Parse(match.Groups[2].Value, CultureInfo.InvariantCulture) }, new CoordinateInfo { X = double.Parse(match.Groups[3].Value, CultureInfo.InvariantCulture), Y = double.Parse(match.Groups[4].Value, CultureInfo.InvariantCulture) }, }); return(true); } result = null; return(false); }