public void UploadDocuments(List <StorageFile> files) { base.SetInProgress(true, ""); int i0 = 0; Action <BackendResult <Doc, ResultCode> > callback = null; callback = delegate(BackendResult <Doc, ResultCode> result) { if (result.ResultCode == ResultCode.Succeeded) { int i; if (i0 == files.Count - 1) { this.SetInProgress(false, ""); } Execute.ExecuteOnUIThread(delegate { DocumentUploadedEvent message = new DocumentUploadedEvent { OwnerId = this.OwnerId, Document = result.ResultData }; EventAggregator.Current.Publish(message); }); i = i0; i0++; this.UploadFile(files[i], callback); return; } this.SetInProgress(false, ""); ExtendedMessageBox.ShowSafe(CommonResources.Error_Generic, CommonResources.Error); }; this.UploadFile(files[i0], callback); }
public void Handle(DocumentUploadedEvent message) { Execute.ExecuteOnUIThread((Action)(() => { if (message.OwnerId != this._ownerId || this.SectionId != 0L && (long)message.Document.type != this.SectionId) { return; } this.Items.Insert(new DocumentHeader(message.Document, (int)this.SectionId, this._isOwnerCommunityAdmined), 0); ++this.Items.TotalCount; this.Items.NotifyChanged(); })); }
public void Handle(DocumentUploadedEvent message) { Execute.ExecuteOnUIThread(delegate { if (message.OwnerId == this._ownerId && (this.SectionId == 0L || (long)message.Document.type == this.SectionId)) { DocumentHeader item = new DocumentHeader(message.Document, (int)this.SectionId, this._isOwnerCommunityAdmined, 0L); this.Items.Insert(item, 0); GenericCollectionViewModel <DocumentsInfo, DocumentHeader> expr_8D = this.Items; int totalCount = expr_8D.TotalCount; expr_8D.TotalCount = totalCount + 1; this.Items.NotifyChanged(); } }); }
public void Handle(DocumentUploadedEvent message) { if (this._blockType != ProfileBlockType.docs || message.OwnerId.ToString() != this._id.Remove(this._id.IndexOf('_')).Remove(0, 3)) { return; } DocumentHeader documentHeader = new DocumentHeader(message.Document, 0, false, 0L); this._id = string.Format("doc{0}_{1}", message.Document.owner_id, message.Document.id); this.GenericTitle = documentHeader.Name; this.GenericSubtitle = documentHeader.GetSizeString(); // ISSUE: method reference this.NotifyPropertyChanged <string>(() => this.GenericTitle); // ISSUE: method reference this.NotifyPropertyChanged <string>(() => this.GenericSubtitle); }