private static CaseInsensitiveDictionary <string> ConvertToDictionary(string[] propertyNamesAndValues)
        {
            var dictionary = new CaseInsensitiveDictionary <string>();

            for (var i = 0; i < propertyNamesAndValues.Length; i += 2)
            {
                dictionary.Add(propertyNamesAndValues[i], propertyNamesAndValues[i + 1]);
            }
            return(dictionary);
        }
        public void Update(Data source)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

            Properties = source.Properties == null ? null : new CaseInsensitiveDictionary <string>(source.Properties);

            if (source.NestedProperties == null)
            {
                NestedProperties = null;
            }
            else
            {
                NestedProperties = new CaseInsensitiveDictionary <Data>(source.NestedProperties.Count);
                foreach (var nestedProperty in source.NestedProperties)
                {
                    var data = new Data();
                    data.Update(nestedProperty.Value);
                    NestedProperties.Add(nestedProperty.Key, data);
                }
            }
        }