public InterlinearEditorForm(Verse verse) { InitializeComponent(); this.Text = "Interlinear Bible Editor"; Uow = new UnitOfWork(); Translation = verse.ParentTranslation;// new XPQuery<Translation>(Uow).Where(x => x.Name == verse.ParentTranslation.Name).FirstOrDefault(); NAME = Translation.Name; var view = new XPView(Uow, typeof(BookBase)); view.CriteriaString = $"[Status.BookType] = {(int)Translation.BookType}"; view.Properties.Add(new ViewProperty("NumberOfBook", SortDirection.None, "[NumberOfBook]", false, true)); view.Properties.Add(new ViewProperty("BookTitle", SortDirection.None, "[BookTitle]", false, true)); var list = new List <BookBaseInfo>(); foreach (ViewRecord item in view) { list.Add(new BookBaseInfo() { NumberOfBook = item["NumberOfBook"].ToInt(), BookTitle = item["BookTitle"].ToString() }); } var index = verse.GetVerseIndex(); btnOblubienicaEu.Visibility = index.NumberOfBook >= 470 ? DevExpress.XtraBars.BarItemVisibility.Always : DevExpress.XtraBars.BarItemVisibility.Never; btnLogosSeptuagint.Visibility = index.NumberOfBook < 470 ? DevExpress.XtraBars.BarItemVisibility.Always : DevExpress.XtraBars.BarItemVisibility.Never; editBook.DataSource = list; VerseControl = new VerseEditorControl() { Dock = DockStyle.Fill }; this.Controls.Add(VerseControl); this.Load += new EventHandler(delegate(object sender, EventArgs e) { Application.DoEvents(); var bookInfo = list.Where(x => x.NumberOfBook == index.NumberOfBook).FirstOrDefault(); txtBook.EditValue = bookInfo; editBook_EditValueChanged(this, new DevExpress.XtraEditors.Controls.ChangingEventArgs(null, bookInfo)); Application.DoEvents(); txtChapter.EditValue = index.NumberOfChapter; editChapter_EditValueChanged(this, new DevExpress.XtraEditors.Controls.ChangingEventArgs(null, index.NumberOfChapter)); Application.DoEvents(); txtVerse.EditValue = index.NumberOfVerse; editVerse_EditValueChanged(this, new DevExpress.XtraEditors.Controls.ChangingEventArgs(null, index.NumberOfVerse)); Application.DoEvents(); }); TransliterationController = new GreekTransliterationController(); }
public InterlinearEditorForm() { InitializeComponent(); this.Text = "Interlinear Bible Editor"; Uow = new UnitOfWork(); Translation = new XPQuery <Translation>(Uow).Where(x => x.Name == NAME).FirstOrDefault(); var view = new XPView(Uow, typeof(BookBase)); view.CriteriaString = "[Status.Oid] = 1 OR [Status.Oid] = 2"; // tylko kanoniczne view.Properties.Add(new ViewProperty("NumberOfBook", SortDirection.None, "[NumberOfBook]", false, true)); view.Properties.Add(new ViewProperty("BookTitle", SortDirection.None, "[BookTitle]", false, true)); var list = new List <BookBaseInfo>(); foreach (ViewRecord item in view) { list.Add(new BookBaseInfo() { NumberOfBook = item["NumberOfBook"].ToInt(), BookTitle = item["BookTitle"].ToString() }); } editBook.DataSource = list; VerseControl = new VerseEditorControl() { Dock = DockStyle.Fill }; this.Controls.Add(VerseControl); TransliterationController = new GreekTransliterationController(); }