private static void LoadProperties(XElement xElement, PropertiesCollection propertiesDictionary) { XElement parent = xElement.Elements().FirstOrDefault(x => x.Name.LocalName == XmlNames.Properties); if (parent != null) { IEnumerable <XElement> properties = parent.Elements(); foreach (XElement property in properties) { string key = property.Attribute(XmlNames.Key)?.Value; if (!string.IsNullOrEmpty(key)) { if (property.HasElements) { var valueElements = property.Elements().Where(x => x.Name.LocalName == XmlNames.Value); if (!propertiesDictionary.ContainsKey(key)) { propertiesDictionary.Add(key, valueElements.Select(x => Json.Deserialize(x.Value))); } } else { string value = property.Value; if (!propertiesDictionary.ContainsKey(key)) { propertiesDictionary.Add(key, Json.Deserialize(value)); } } } } } }