public static ElementDataDictionary Deserialize(string data)
        {
            var dictionary = new ElementDataDictionary();

            if (String.IsNullOrWhiteSpace(data))
            {
                return(dictionary);
            }

            var items = data.Split(new[] { '&' });

            foreach (var item in items)
            {
                var pair  = item.Split(new[] { '=' });
                var key   = HttpUtility.UrlDecode(pair[0]);
                var value = HttpUtility.UrlDecode(pair[1]);

                if (!dictionary.ContainsKey(key) && !_elementDataBlackList.Contains(key))
                {
                    dictionary.Add(key, value);
                }
            }

            return(dictionary);
        }
        public static ElementDataDictionary Combine(this ElementDataDictionary target, ElementDataDictionary input, bool removeNonExistingItems = false)
        {
            var combined = new ElementDataDictionary(target);

            foreach (var item in input)
            {
                combined[item.Key] = item.Value;
            }

            if (removeNonExistingItems)
            {
                foreach (var item in target)
                {
                    if (!input.ContainsKey(item.Key))
                    {
                        combined.Remove(item.Key);
                    }
                }
            }
            return(combined);
        }
 public static string Get(this ElementDataDictionary data, string key, string defaultValue = null)
 {
     return(data != null?data.ContainsKey(key) ? data[key] : defaultValue : defaultValue);
 }