Example #1
0
        private Boolean SaveXml()
        {
            String          path = GetPath();
            UserDataObjects objs = new UserDataObjects();

            foreach (String key in _Dic.Keys)
            {
                objs.Lists.Add(_Dic[key]);
            }

            XmlSerialize.SerializeFile(objs, path);

            _Dic.Clear();

            LoadXml();
            return(true);
        }
Example #2
0
        private Boolean LoadXml()
        {
            _Dic.Clear();
            String path = GetPath();

            try
            {
                UserDataObjects objs = XmlSerialize.DeserializeFile(typeof(UserDataObjects), path) as UserDataObjects;
                if (objs != null)
                {
                    foreach (UserDataObject obj in objs.Lists)
                    {
                        String key = obj.Key;
                        _Dic.Add(key, obj);
                    }
                }
            }
            catch
            {
            }
            return(true);
        }