SaveAsync() public method

public SaveAsync ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task
Beispiel #1
0
        public static async Task <Settings> LoadAsync()
        {
            var      store  = new IsolatedStorage <Settings>();
            Settings result = null;

            try
            {
                Debug.WriteLine("Loading settings from : " + SettingsFolder);
                result = await store.LoadFromFileAsync(SettingsFolder, SettingsFileName);
            }
            catch
            {
            }
            if (result == null)
            {
                result = new Settings();
                await result.SaveAsync();
            }
            return(result);
        }
 public static async Task<Settings> LoadAsync()
 {
     var store = new IsolatedStorage<Settings>();
     Settings result = null;
     try
     {
         Debug.WriteLine("Loading settings from : " + SettingsFolder);
         result = await store.LoadFromFileAsync(SettingsFolder, SettingsFileName);
     }
     catch
     {
     }
     if (result == null)
     {
         result = new Settings();
         await result.SaveAsync();
     }
     return result;
 }