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); });
/// <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); });