private BibleStatisticsForm() { Icon = Globals.MainForm.Icon; var temp = MainForm.Instance.Cursor; MainForm.Instance.Cursor = Cursors.WaitCursor; try { InitializeComponent(); InitializeCounters(); InitializeMiddle(); InitializeOccurences(); SelectBook.DataSource = new BindingList <BookRow>(ApplicationDatabase.Instance.Books); SelectBook.DisplayMember = "Name"; } finally { MainForm.Instance.Cursor = temp; } ActionWordSearchOnline.InitializeFromProviders(HebrewGlobals.WebProvidersWord, (sender, e) => { if (sender is not ToolStripMenuItem menuitem) { return; } HebrewTools.OpenWordProvider((string)menuitem.Tag, LastLabelClicked.Text); });
public EditBooksForm() { InitializeComponent(); Icon = MainForm.Instance.Icon; ActionSearchOnline.InitializeFromProviders(HebrewGlobals.WebProvidersWord, (sender, e) => { var menuitem = (ToolStripMenuItem)sender; HebrewTools.OpenWordProvider((string)menuitem.Tag, SelectedBook?.Hebrew); }); }
/// <summary> /// Creates providers links menu items. /// </summary> private void CreateProvidersLinks() { // Word search online ActionWordSearchOnline.InitializeFromProviders(HebrewGlobals.WebProvidersWord, (sender, e) => { if (sender is not ToolStripMenuItem menuitem) { return; } var contextmenu = (menuitem?.GetCurrentParent() as ToolStripDropDownMenu)?.OwnerItem?.Owner as ContextMenuStrip; var control = contextmenu?.SourceControl?.Parent as WordControl; string word = control?.Reference.Word.Hebrew ?? string.Empty; HebrewTools.OpenWordProvider((string)menuitem.Tag, word); });
/// <summary> /// Creates providers links menu items. /// </summary> private void CreateProvidersLinks() { ContextMenuSearchOnline.InitializeFromProviders(HebrewGlobals.WebProvidersWord, (sender, e) => { var menuitem = (ToolStripMenuItem)sender; HebrewTools.OpenWordProvider((string)menuitem.Tag, EditWord.TextBox.Text, Settings.CustomWebSearch); EditWord.Focus(); }); var menuitem = new ToolStripMenuItem(HebrewTranslations.HebrewWordsSearch.GetLang(), HebrewWordsIcon); menuitem.Click += (sender, e) => HebrewTools.OpenHebrewWordsSearchWord(EditWord.InputText, Settings.HebrewWordsExe); if (ContextMenuSearchOnline.Items.Count > 0) { ContextMenuSearchOnline.Items.Insert(0, new ToolStripSeparator()); } ContextMenuSearchOnline.Items.Insert(0, menuitem); ContextMenuOpenConcordance.InitializeFromProviders(HebrewGlobals.WebProvidersConcordance, (sender, e) => { var menuitem = (ToolStripMenuItem)sender; HebrewTools.OpenWordConcordance((string)menuitem.Tag, (int)EditConcordance.Value); EditWord.Focus(); }); }