/// <summary> /// Handler method that's called when the "Open bookmark in new window..." menu item in the context menu that appears when the user right-clicks on a /// bookmark item in <see cref="_bookmarksListView"/>. /// </summary> /// <param name="sender">Object from which this event originated.</param> /// <param name="e">Arguments associated with this event.</param> private void _openBookmarkNewWindowMenuItem_Click(object sender, EventArgs e) { MainForm mainForm = new MainForm( new List<IConnection> { _listViewConnections[_bookmarksListView.SelectedItems[0]] }); ParentTabs.ApplicationContext.OpenWindow(mainForm); mainForm.Show(); }
/// <summary> /// Handler method that's called when the "Open all in new window..." menu item in the context menu that appears when the user right-clicks on a /// folder in <see cref="_bookmarksFoldersTreeView"/>. Batches up the <see cref="IConnection.Guid"/>s of all of the bookmarks in the selected folder /// and its descendants and creates a new <see cref="MainForm"/> instance with them. /// </summary> /// <param name="sender">Object from which this event originated.</param> /// <param name="e">Arguments associated with this event.</param> private void _folderOpenAllNewWindowMenuItem_Click(object sender, EventArgs e) { // Look recursively into this folder and its descendants to get all of the bookmarks List<IConnection> bookmarks = new List<IConnection>(); FindAllBookmarks(_contextMenuItem as BookmarksFolder, bookmarks); if (bookmarks.Count > 0) { MainForm mainForm = new MainForm(bookmarks); ParentTabs.ApplicationContext.OpenWindow(mainForm); mainForm.Show(); } }