Example #1
0
 public static void ActionNewSpaceOrPage()
 {
     if (Globals.XWord2003AddIn.Wiki != null)
     {
         AddPageForm addPageForm = new AddPageForm(ref Globals.XWord2003AddIn.Wiki);
         new AddPageFormManager(ref addPageForm).EnqueueAllHandlers();
         addPageForm.ShowDialog();
     }
     else
     {
         UserNotifier.Error(UIMessages.WIKI_STRUCTURE_NOT_LOADED);
     }
 }
Example #2
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="addPageForm">A reference to an <code>AddPageForm</code> instance.</param>
 public AddPageFormManager(ref AddPageForm addPageForm)
 {
     this.addPageForm = addPageForm;
 }
 private void btnSavePage_Click(object sender, RibbonControlEventArgs e)
 {
     try
     {
         if (Addin.currentPageFullName == "" || Addin.currentPageFullName == null)
         {
             AddPageForm addPageForm = new AddPageForm(ref Addin.wiki, false, true);
             new AddPageFormManager(ref addPageForm).EnqueueAllHandlers();
             addPageForm.ShowDialog();
         }
         else
         {
             try
             {
                 Addin.AddinActions.SaveToServer();
             }
             catch (Exception ex)
             {
                 Log.Exception(ex);
                 UserNotifier.Exclamation("There was an error when trying to save the page to the server");
             }
         }
     }
     catch(NullReferenceException ex)
     {
         Log.Exception(ex);
         UserNotifier.Exclamation("You are not currently editing a wiki page");
     }
 }
 private void btnNewPage_Click(object sender, RibbonControlEventArgs e)
 {
     AddPageForm addPageForm = new AddPageForm(ref Globals.XWikiAddIn.wiki);
     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();
     }
 }
 /// <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();
     }
 }
 /// <summary>
 /// Event triggered when the "Add Space" button is pressed.
 /// </summary>
 private void btnAddSpace_Click(object sender, EventArgs e)
 {
     AddPageForm addPageForm = new AddPageForm(ref Globals.XWikiAddIn.wiki, true, false);
     new AddPageFormManager(ref addPageForm).EnqueueAllHandlers();
     addPageForm.ShowDialog();
 }