private void OnAdd_Click(object sender, System.Windows.RoutedEventArgs e) { try { if (this.selectedReportType == ReportTypeEnum.ReportContent && !this.reportCategoryId.HasValue) { throw new ApplicationException("Invalid report category selected"); } ReportDesigner designer = new ReportDesigner(new ReportMasterModel { ReportTypeEnum = (int)this.selectedReportType, PaperKindEnum = (int)PaperKind.A4, PageOrientationEnum = (int)PageOrientationEnum.Portrait, PageMarginTop = 100, PageMarginBottom = 100, PageMarginLeft = 100, PageMarginRight = 100, ProjectName = General.ProjectModel.ModelName, CategoryId = this.reportCategoryId }); ControlDialog.WindowsShowIsClosing += this.WindowsShow_IsClosing; ControlDialog.Show($"New {this.selectedReportType.GetDescriptionAttribute()}", designer, "Save", windowState: WindowState.Maximized); } catch (Exception err) { MessageBox.Show(err.InnerExceptionMessage()); } }
private void EditStudy_Click(object sender, System.Windows.RoutedEventArgs e) { if (this.SelectedStudyHeader == null) { MessageDisplay.Show("Please select a Study."); return; } try { #region CHECK FOR OPEN STUDIES foreach (Window window in Application.Current.Windows) { if (window.GetType() != typeof(ControlWindow)) { continue; } UserControlBase controlBase = window.GetPropertyValue("ControlContent").To <UserControlBase>(); if (controlBase.GetType() != typeof(EditStudy)) { continue; } StudyHeader studyHeader = controlBase.GetPropertyValue("SubjectHeader").To <StudyHeader>(); if (studyHeader.StudyHeaderId <= 0) { continue; } window.Focus(); this.CloseIfNotMainWindow(true); return; } #endregion EditStudy edit = new EditStudy(this.SelectedStudyHeader); ControlDialog.Show(this.SelectedStudyHeader.StudyName, edit, "SaveStudy", autoSize: false); this.CloseIfNotMainWindow(true); } catch (Exception err) { ErrorLog.ShowError(err); } }
private static void StudyBookmark_Selected(object sender, RoutedEventArgs e) { try { MenuItem item = (MenuItem)sender; string studyKey = item.Tag.ParseToString(); string[] keySplit = studyKey.Split(new string[] { "||" }, StringSplitOptions.None); int studyHeaderId = keySplit[0].ToInt32(); #region CHECK FOR OPEN STUDIES foreach (Window window in Application.Current.Windows) { if (window.GetType() != typeof(ControlWindow)) { continue; } UserControlBase controlBase = window.GetPropertyValue("ControlContent").To <UserControlBase>(); if (controlBase.GetType() != typeof(EditStudy)) { continue; } StudyHeader studyHeader = controlBase.GetPropertyValue("SubjectHeader").To <StudyHeader>(); if (studyHeader.StudyHeaderId <= 0) { continue; } window.Focus(); return; } #endregion StudyHeaderModel model = BiblesData.Database.GetStudyHeader(studyHeaderId.ToInt32()); EditStudy edit = new EditStudy(model); ControlDialog.Show(model.StudyName, edit, "SaveStudy", autoSize: false); } catch (Exception err) { ErrorLog.ShowError(err); } }
private void NewStudy_Cliked(object sender, RoutedEventArgs e) { try { EditStudy study = new EditStudy(); ControlDialog.Show("New Study", study, "SaveStudy", owner: this, autoSize: false); } catch (Exception err) { ErrorLog.ShowError(err); } }
private void Highlights_Cliked(object sender, RoutedEventArgs e) { try { BibleHighlights highlight = new BibleHighlights(); ControlDialog.Show("Highlights", highlight, string.Empty, showCancelButton: false, autoSize: false); } catch (Exception err) { ErrorLog.ShowError(err);; } }
private void Search_Cliked(object sender, RoutedEventArgs e) { try { SearchView search = new SearchView(); ControlDialog.Show("Search", search, string.Empty, owner: this, showCancelButton: false); } catch (Exception err) { ErrorLog.ShowError(err); } }
private void OnlineResources_Cliked(object sender, RoutedEventArgs e) { try { OnlineResources resources = new OnlineResources(); ControlDialog.Show("Resource Centre", resources, string.Empty, owner: this, autoSize: false); } catch (Exception err) { ErrorLog.ShowError(err); } }
private void Dictionaries_Cliked(object sender, RoutedEventArgs e) { try { DictionaryViewer dictionary = new DictionaryViewer(); ControlDialog.Show("Dictionaries", dictionary, string.Empty, showOkButton: false, autoSize: false); } catch (Exception err) { ErrorLog.ShowError(err); } }
private void LanguageSetup_Cliked(object sender, RoutedEventArgs e) { try { TranslationSetup setup = new TranslationSetup(); //if (ControlDialog.ShowDialog("Translation Setup", setup, "SaveSetup", autoSize:false).IsFalse()) ControlDialog.Show("Translation Setup", setup, "SaveSetup", owner: this, autoSize: false); } catch (Exception err) { ErrorLog.ShowError(err); } }
private void Bookmarks_Cliked(object sender, RoutedEventArgs e) { try { BookmarksList bookmarks = new BookmarksList(); bookmarks.BookmarkReaderRequest += this.BookmarkReader_Request; ControlDialog.Show("Bookmarks", bookmarks, string.Empty, owner: this, isTopMost: true, autoSize: false); } catch (Exception err) { ErrorLog.ShowError(err); } }
private void NewStudy_Click(object sender, RoutedEventArgs e) { try { this.newStudy = new EditStudy(); ControlDialog.ControlDialogClosing += this.ControlDialog_Closing; ControlDialog.Show("New Study", this.newStudy, "SaveStudy", autoSize: false, owner: Application.Current.MainWindow); } catch (Exception err) { ErrorLog.ShowError(err); } }
private void Notes_Cliked(object sender, RoutedEventArgs e) { try { VersesNotes notes = new VersesNotes(); notes.VerseNoteGridModelRequest += this.VerseNoteGridModel_Request; ControlDialog.Show("Verses Notes", notes, string.Empty, showOkButton: false, autoSize: false); } catch (Exception err) { ErrorLog.ShowError(err);; } }
private void ModelItem_Browse(object sender, string buttonKey) { try { ModelViewObject modelObject = (ModelViewObject)sender; string strongsNumber = modelObject[0].GetValue().ParseToString(); StrongsVerses verseView = new StrongsVerses(this.BibleId, strongsNumber, this.verseKey); ControlDialog.Show(strongsNumber, verseView, string.Empty, showCancelButton: false, autoSize: false, owner: this.GetParentWindow()); } catch (Exception err) { ErrorLog.ShowError(err); } }
public bool TryEditStudy() { if (this.SelectedStudyHeader == null) { MessageDisplay.Show("Please select a Study."); return(false); } #region CHECK FOR OPEN STUDIES foreach (Window window in Application.Current.Windows) { if (window.GetType() != typeof(ControlWindow)) { continue; } UserControlBase controlBase = window.GetPropertyValue("ControlContent").To <UserControlBase>(); if (controlBase.GetType() != typeof(EditStudy)) { continue; } StudyHeader studyHeader = controlBase.GetPropertyValue("SubjectHeader").To <StudyHeader>(); if (studyHeader.StudyHeaderId <= 0 || studyHeader.StudyHeaderId != this.SelectedStudyHeader.StudyHeaderId) { continue; } window.Focus(); return(true); } #endregion EditStudy edit = new EditStudy(this.SelectedStudyHeader); ControlDialog.Show(this.SelectedStudyHeader.StudyName, edit, "SaveStudy", autoSize: false, owner: Application.Current.MainWindow); return(true); }
private void OnEdit_Click(object sender, System.Windows.RoutedEventArgs e) { if (this.SelectedHeaderAndFooter == null) { MessageBox.Show("Please select a Report Object"); return; } try { ReportDesigner designer = new ReportDesigner(this.SelectedHeaderAndFooter); ControlDialog.Show($"Edit {this.selectedReportType.GetDescriptionAttribute()}", designer, "Save", windowState: WindowState.Maximized); } catch (Exception err) { MessageBox.Show(err.InnerExceptionMessage()); } }