Exemple #1
0
        private void WriteProperties(IDictionary <string, string> properties)
        {
            var list       = properties.Select(x => new SerializableKeyValuePair <string, string>(x.Key, x.Value)).ToList();
            var serializer = new TypedXmlSerializer <List <SerializableKeyValuePair <string, string> > >();
            var data       = serializer.SerializeToString(list);

            _appDataService.WriteAppData(_appDataKey, data);
        }
Exemple #2
0
        public void Refresh()
        {
            var items = GetItemsFromSource();

            _items.Clear();
            _items.AddRange(items);

            var serializer = new TypedXmlSerializer <List <T> >();
            var serialized = serializer.SerializeToString(items);

            _appDataService.WriteAppData(AppDataKey, serialized);
        }
Exemple #3
0
        public void SetCredential(ExternalSystem system, NetworkCredential credential)
        {
            var serializer = new TypedXmlSerializer <SerializableNetworkCredential>();
            var temp       = new SerializableNetworkCredential
            {
                UserName = credential.UserName,
                Password = credential.Password,
                Domain   = credential.Domain
            };

            var data = serializer.SerializeToString(temp);

            _appDataService.WriteAppData(GetAppDataKey(system), data);
        }