private void InitializeMenu() { ActionStudyOnline.InitializeFromProviders(HebrewGlobals.WebProvidersCelebration, (sender, e) => { if (SelectCelebration.SelectedItems.Count <= 0) { return; } var menuitem = (ToolStripMenuItem)sender; var celebration = (TorahCelebration)SelectCelebration.SelectedItems[0].Tag; HebrewTools.OpenCelebrationProvider((string)menuitem.Tag, celebration); }); ActionOpenVerseOnline.InitializeFromProviders(HebrewGlobals.WebProvidersBible, (sender, e) => { var menuitem = (ToolStripMenuItem)sender; foreach (ListViewItem item in SelectVerse.SelectedItems) { var verseitem = (Tuple <TanakBook, string, string>)item.Tag; var reference = $"{(int)verseitem.Item1}.{verseitem.Item2}"; HebrewTools.OpenBibleProvider((string)menuitem.Tag, reference); if (SelectVerse.SelectedItems.Count > 1) { Thread.Sleep(1500); } } }); }
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); }); }
private void ActionOpenHebrewWordsVerse_Click(object sender, EventArgs e) { if (SelectVerse.SelectedItems.Count <= 0) { return; } var verseitem = (Tuple <TanakBook, string, string>)SelectVerse.SelectedItems[0].Tag; var reference = $"{(int)verseitem.Item1}.{verseitem.Item2}"; HebrewTools.OpenHebrewWordsGoToVerse(reference); }
/// <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(); }); }