Пример #1
0
        private void NewNote(object param)
        {
            bool createUnfiled = Convert.ToBoolean(param);

            try
            {
                string initialTitle = this.noteService.GetUniqueNoteTitle(ResourceUtils.GetString("Language_New_Note"));

                FlowDocument flowDoc = new FlowDocument();

                Notebook theNotebook = default(Notebook);

                if (!createUnfiled & (this.SelectedNotebook != null && !this.SelectedNotebook.IsDefaultNotebook))
                {
                    theNotebook = this.SelectedNotebook.Notebook;
                }
                else
                {
                    theNotebook = NotebookViewModel.CreateUnfiledNotesNotebook().Notebook;
                }

                NoteWindow notewin = new NoteWindow(initialTitle, "", theNotebook, this.searchService.SearchText, true, this.appearanceService, this.jumpListService, this.eventAggregator, this.noteService,
                                                    this.dialogService);

                notewin.ActivateNow();

                RefreshNotes();
            }
            catch (Exception)
            {
                this.dialogService.ShowNotificationDialog(null, title: ResourceUtils.GetString("Language_Error"), content: ResourceUtils.GetString("Language_Problem_Creating_Note"), okText: ResourceUtils.GetString("Language_Ok"), showViewLogs: false);
            }
        }