示例#1
0
 public async Task SetRemoteIdGuid(ContactStore store)
 {
     IDictionary<string, object> properties;
     properties = await store.LoadExtendedPropertiesAsync().AsTask<IDictionary<string, object>>();
     if (!properties.ContainsKey(ContactStoreLocalInstanceIdKey))
     {
         // the given store does not have a local instance id so set one against store extended properties
         Guid guid = Guid.NewGuid();
         properties.Add(ContactStoreLocalInstanceIdKey, guid.ToString());
         System.Collections.ObjectModel.ReadOnlyDictionary<string, object> readonlyProperties = new System.Collections.ObjectModel.ReadOnlyDictionary<string, object>(properties);
         await store.SaveExtendedPropertiesAsync(readonlyProperties).AsTask();
     }
 }
 public async Task TrySetRemoteIdGuid(ContactStore store)
 {
   var extendedProperties = await store.LoadExtendedPropertiesAsync().AsTask();
   if (!extendedProperties.ContainsKey(ContactStoreKey))
   {
     // the given store does not have a local instance id so set one against store extended properties
     var guid = Guid.NewGuid();
     extendedProperties.Add(ContactStoreKey, guid.ToString());
     
     var readonlyProperties = new ReadOnlyDictionary<string, object>(extendedProperties);
     await store.SaveExtendedPropertiesAsync(readonlyProperties);
   }
 }
示例#3
0
        public async Task TrySetRemoteIdGuid(ContactStore store)
        {
            var extendedProperties = await store.LoadExtendedPropertiesAsync().AsTask();

            if (!extendedProperties.ContainsKey(ContactStoreKey))
            {
                // the given store does not have a local instance id so set one against store extended properties
                var guid = Guid.NewGuid();
                extendedProperties.Add(ContactStoreKey, guid.ToString());

                var readonlyProperties = new ReadOnlyDictionary <string, object>(extendedProperties);
                await store.SaveExtendedPropertiesAsync(readonlyProperties);
            }
        }
示例#4
0
        public async Task SetRemoteIdGuid(ContactStore store)
        {
            IDictionary <string, object> properties;

            properties = await store.LoadExtendedPropertiesAsync().AsTask();

            if (!properties.ContainsKey(ContactStoreLocalInstanceIdKey))
            {
                var guid = Guid.NewGuid();
                properties.Add(ContactStoreLocalInstanceIdKey, guid.ToString());
                var readonlyProperties = new ReadOnlyDictionary <string, object>(properties);
                await store.SaveExtendedPropertiesAsync(readonlyProperties).AsTask();
            }
        }
示例#5
0
        public async Task SetRemoteIdGuid(ContactStore store)
        {
            IDictionary <string, object> properties;

            properties = await store.LoadExtendedPropertiesAsync().AsTask <IDictionary <string, object> >();

            if (!properties.ContainsKey(ContactStoreLocalInstanceIdKey))
            {
                // the given store does not have a local instance id so set one against store extended properties
                Guid guid = Guid.NewGuid();
                properties.Add(ContactStoreLocalInstanceIdKey, guid.ToString());
                System.Collections.ObjectModel.ReadOnlyDictionary <string, object> readonlyProperties = new System.Collections.ObjectModel.ReadOnlyDictionary <string, object>(properties);
                await store.SaveExtendedPropertiesAsync(readonlyProperties).AsTask();
            }
        }