CloudinaryDotNet.Actions.BaseParams.AddCoordinates C# (CSharp) Метод

AddCoordinates() защищенный Метод

Adds a coordinate object (plain string or Rectangle or List of Rectangles or FaceCoordinates)
protected AddCoordinates ( object>.SortedDictionary dict, string key, object coordObj ) : void
dict object>.SortedDictionary The dictionary.
key string The key.
coordObj object The value.
Результат void
        protected void AddCoordinates(SortedDictionary<string, object> dict, string key, object coordObj)
        {
            if (coordObj == null) return;

            if (coordObj is Rectangle)
            {
                var rect = (Rectangle)coordObj;
                dict.Add(key, string.Format("{0},{1},{2},{3}", rect.X, rect.Y, rect.Width, rect.Height));
            }
            else if (coordObj is List<Rectangle>)
            {
                var list = (List<Rectangle>)coordObj;
                dict.Add(key, string.Join("|", list.Select(r => string.Format("{0},{1},{2},{3}", r.X, r.Y, r.Width, r.Height)).ToArray()));
            }
            else
            {
                dict.Add(key, coordObj.ToString());
            }
        }