public async Task ProcessFileSynchronizationAction(Microsoft.WindowsAzure.MobileServices.Files.MobileServiceFile file, FileSynchronizationAction action) { if (action == FileSynchronizationAction.Delete) { FileHelper.DeleteLocalFile(file); } else // Create or update. We're aggressively downloading all files. { await this.todoItemManager.DownloadFileAsync(file); } }
public async Task ProcessFileSynchronizationAction(MobileServiceFile file, FileSynchronizationAction action) { switch(action) { case FileSynchronizationAction.Create: case FileSynchronizationAction.Update: var stream = await client.GetFileAsync(file); await localStorage.AddAsync(file, stream); break; case FileSynchronizationAction.Delete: await localStorage.DeleteAsync(file); break; } }
public async Task ProcessFileSynchronizationAction(MobileServiceFile file, FileSynchronizationAction action) { try { if (action == FileSynchronizationAction.Delete) { await FileHelper.DeleteLocalFileAsync(file, theApp.DataFilesPath); } else { // Create or update - download large format image by looking for 'lg' in the StoreUri parameter Trace.WriteLine(string.Format("File - storeUri: {1}", file.Name, file.StoreUri)); if (file.StoreUri.Contains("lg")) { await this.theApp.DownloadFileAsync(file); } } } catch (Exception e) { // should catch WrappedStorageException, but this type is internal in the Storage SDK! Trace.WriteLine("Exception while downloading blob, blob probably does not exist: " + e); } }
public async Task ProcessFileSynchronizationAction(MobileServiceFile file, FileSynchronizationAction action) { }