private async void OnFileOperationCompleted(FileOperationCompletedEvent obj) { if (obj.Source == FileOperationSource.Local) { IMobileServiceSyncTable table = this.mobileServiceClient.GetSyncTable(obj.File.TableName); JObject item = await table.LookupAsync(obj.File.ParentId); if (item != null) { await table.UpdateAsync(item); } } }
private bool ValidateNotification(FileOperationCompletedEvent e) { return(e.Kind == FileOperationKind.Delete && e.Source == FileOperationSource.Local && this.inputFile.Equals(e.File)); }
internal void NotifyFileOperationCompletion(MobileServiceFile file, FileOperationKind fileOperationKind, FileOperationSource source) { var operationCompletedEvent = new FileOperationCompletedEvent(file, fileOperationKind, source); this.eventManager.PublishAsync(operationCompletedEvent).ContinueWith(t => t.Exception.Handle(e => true), TaskContinuationOptions.OnlyOnFaulted); }
private bool ValidateUpdateNotification(FileOperationCompletedEvent e) { return(e.Kind == FileOperationKind.Update && e.Source == FileOperationSource.ServerPull && string.Compare(e.File.Id, "updated-123") == 0); }