Example #1
0
        public static XElement ToXElement(this FullDictionary <char, CharacterInfo> dict)
        {
            XElement result = new XElement(strCharacterInfoDict,
                                           from item in dict
                                           select KeyValuePairHelper.ToXElement(item));

            return(result);
        }
Example #2
0
        public static FullDictionary <char, CharacterInfo> Parse(XElement xElement)
        {
            FullDictionary <char, CharacterInfo> result = new FullDictionary <char, CharacterInfo>(
                CharacterInfo.Default);

            foreach (var item in xElement.Elements(KeyValuePairHelper.strKeyValuePair))
            {
                KeyValuePair <char, CharacterInfo> pair = KeyValuePairHelper.Parse(item);
                result.Add(pair.Key, pair.Value);
            }

            return(result);
        }