private void btnNewPage_Click(object sender, RibbonControlEventArgs e) { AddPageForm addPageForm = new AddPageForm(ref Globals.XWikiAddIn.wiki); new AddPageFormManager(ref addPageForm).EnqueueAllHandlers(); addPageForm.Show(); }
/// <summary> /// Event triggered when the "New Page" context button is pressed. /// </summary> /// <param name="sender">The control that triggered the event.</param> /// <param name="e">The event paramaters.</param> private void cmnuNewPage_Click(object sender, EventArgs e) { if (treeView.SelectedNode.Level == TREE_SPACE_LEVEL) { String spaceName = treeView.SelectedNode.Text; Wiki wiki = Wiki; AddPageForm addPageForm = new AddPageForm(ref wiki, spaceName); new AddPageFormManager(ref addPageForm).EnqueueAllHandlers(); addPageForm.Show(); } }
private void btnAddPage_Click(object sender, RibbonControlEventArgs e) { TreeView treeView = Globals.XWikiAddIn.XWikiTaskPane.treeView; if (treeView.SelectedNode != null) { String spaceName = treeView.SelectedNode.Text; AddPageForm addPageForm = new AddPageForm(ref Globals.XWikiAddIn.wiki, spaceName); new AddPageFormManager(ref addPageForm).EnqueueAllHandlers(); addPageForm.Show(); } else { //see XOFFICE-20 //MessageBox.Show("You need to select a space in the wiki explorer.","XWord"); AddPageForm addPageForm = new AddPageForm(ref Globals.XWikiAddIn.wiki, true, false); new AddPageFormManager(ref addPageForm).EnqueueAllHandlers(); addPageForm.ShowDialog(); } }