public IEnumerable<IResult> NoteRemove()
        {
            if (this.SelectedNote != null)
            {
                string removemessage = "Are you sure you want to delete this note?\n";
                var showDialog = UILib.DialogDelete(removemessage);
                yield return showDialog;
                if (showDialog.Dialog.WasSelected(MessageBoxOptions.No))
                {
                    yield break;
                }

                BusyOn("Removing Note...");
                // TODO Server Side check if remove allowed..
                RemoveNoteRequest removeNoteRequest = new RemoveNoteRequest((int)this.SelectedNote.NoteId);
                yield return removeNoteRequest;
                if (removeNoteRequest.Error != null)
                {
                    yield return new HandleExceptionResult(removeNoteRequest.Error);
                    BusyOff();
                    yield break;
                }

                BusyOn("Loading Notes...");
                GetNotesRequest getNotesRequest = new GetNotesRequest();
                yield return getNotesRequest;
                if (getNotesRequest.Error != null)
                {
                    yield return new HandleExceptionResult(getNotesRequest.Error);
                }
                this.Notes = getNotesRequest.Result;
                NotesView.NoteGrid.Enable(defaultFocusDelegate);
                NotesView.NoteData.Disable();
                NotifyOfPropertyChange(() => AssistantNoteMode);
                this.HasLoadedNotes = true;

                BusyOff();
            }
        }
示例#2
0
 private IEnumerator<IResult> GetNotes()
 {
     if (UILib.IsDesignMode())
         yield break;
     GetNotesRequest getNotesRequest = new GetNotesRequest();
     yield return getNotesRequest;
     if (getNotesRequest.Error != null)
     {
         yield return new HandleExceptionResult(getNotesRequest.Error);
         yield break;
     }
     Instance.Notes = getNotesRequest.Result.Clone();
 }
        public IEnumerable<IResult> LoadViewNotes()
        {
            if (this.HasLoadedNotes)
                yield break;

            GetNotesRequest getNotesRequest = new GetNotesRequest();
            yield return getNotesRequest;
            if (getNotesRequest.Error != null)
            {
                yield return new HandleExceptionResult(getNotesRequest.Error);
            }
            this.Notes = getNotesRequest.Result;
            NotesView.NoteGrid.Enable(defaultFocusDelegate);
            NotesView.NoteData.Disable();
            NotifyOfPropertyChange(() => AssistantNoteMode);
            this.HasLoadedNotes = true;
        }