Example #1
0
 // attached in ctor to trigger taskpane visibility has been changed and update the checkbutton in the ribbon ui for show/hide taskpane
 private void TaskPane_VisibleStateChange(Office._CustomTaskPane CustomTaskPaneInst)
 {
     // ouer taskpane visibility has been changed. we send a message to the host application
     // and say please refresh the checkbutton state. now the host application want call ouer OnGetPressedPanelToggle method to update the checkstate.
     if(null != RibbonUI)
         RibbonUI.InvalidateControl("paneVisibleToogleButton");
 }
Example #2
0
 // defined in RibbonUI.xml to track the user clicked ouer checkbutton. then we upate the panel visibility at hand.
 public void OnCheckPanelToggle(Office.IRibbonControl control, bool pressed)
 {
     TaskPanes[0].Visible = pressed;
 }
Example #3
0
 // defined in RibbonUI.xml to make sure the checkbutton state is up-to-date and synchronized with taskpane visibility.
 public bool OnGetPressedPanelToggle(Office.IRibbonControl control)
 {
     return TaskPanes[0].Visible;
 }
Example #4
0
 // defined in RibbonUI.xml to get a instance for ouer ribbon ui.
 public void OnLoadRibonUI(Office.IRibbonUI ribbonUI)
 {
     RibbonUI = ribbonUI;
 }
Example #5
0
 // defined in RibbonUI.xml to catch the user click for the about button
 public void OnClickAboutButton(Office.IRibbonControl control)
 {
     Utils.Dialog.ShowAbout("NetOffice Addin Example", "http://netoffice.codeplex.com", "<No licence set>");
 }
Example #6
0
 // defined in RibbonUI.xml to catch the user click for the about button
 public void OnClickAboutButton(Office.IRibbonControl control)
 {
     MessageBox.Show("NetOffice Tools - Extended Sample Addin.", "ExtendedAccessCS4.Addin");
 }
Example #7
0
 public void OnAction(Office.IRibbonControl control)
 {
     try
     {
         switch (control.Id)
         {
             case "customButton1":
                 MessageBox.Show("This is the first sample button.", _progId);
                 break;
             case "customButton2":
                 MessageBox.Show("This is the second sample button.", _progId);
                 break;
             default:
                 MessageBox.Show("Unkown Control Id: " + control.Id, _progId);
                 break;
         }
     }
     catch (Exception throwedException)
     {
         string details = string.Format("{1}{1}Details:{1}{1}{0}", throwedException.Message, Environment.NewLine);
         MessageBox.Show("An error occured." + details, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #8
0
 // taskpane visibility has been changed. we upate the checkbutton in the ribbon ui for show/hide taskpane
 protected override void TaskPaneVisibleStateChanged(Office._CustomTaskPane customTaskPaneInst)
 {
     if (null != RibbonUI)
         RibbonUI.InvalidateControl("paneVisibleToogleButton");
 }
Example #9
0
 // attached in ctor to trigger taskpane visibility has been changed and update the checkbutton in the ribbon ui for show/hide taskpane
 private void TaskPane_VisibleStateChange(Office._CustomTaskPane CustomTaskPaneInst)
 {
     if(null != RibbonUI) // may no ribbon supported
         RibbonUI.InvalidateControl("paneVisibleToogleButton");
 }
Example #10
0
 public void OnAction(Office.IRibbonControl control)
 {
     try
     {
         switch (control.Id)
         {
             case "customButton1":
                 MessageBox.Show("This is the first sample button.", _prodId);
                 break;
             case "customButton2":
                 MessageBox.Show("This is the second sample button.", _prodId);
                 break;
             default:
                 MessageBox.Show("Unkown Control Id: " + control.Id, _prodId);
                 break;
         }
     }
     catch (Exception exception)
     {
         string message = string.Format("An error occured.{0}{0}{1}", Environment.NewLine, exception.Message);
         MessageBox.Show(message, _prodId, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #11
0
        public void OnAction(Office.IRibbonControl control)
        {
            try
            {
                switch (control.Id)
                {
                    case "btnStartSlideShow":
                        // Set the event listener for the beginning of the show
                        _powerApplication.SlideShowBeginEvent += new PowerPoint.Application_SlideShowBeginEventHandler(powerApplication_SlideShowBeginEvent);

                        // Set the event listener for the end of the show
                        _powerApplication.SlideShowEndEvent += new PowerPoint.Application_SlideShowEndEventHandler(powerApplication_SlideShowEndEvent);

                        // Start the Slide show
                        _powerApplication.ActiveWindow.Presentation.SlideShowSettings.Run();

                        break;
                    case "customButton2":
                        MessageBox.Show("This is the second sample button.", _progId);
                        break;
                    default:
                        MessageBox.Show("Unkown Control Id: " + control.Id, _progId);
                        break;
                }
            }
            catch (Exception throwedException)
            {
                string details = string.Format("{1}{1}Details:{1}{1}{0}", throwedException.Message, Environment.NewLine);
                MessageBox.Show("An error occured." + details, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #12
0
 public string GetLabel(Office.IRibbonControl control)
 {
     return Factory.Settings.ExceptionMessage;
 }
Example #13
0
 private void TaskPane_VisibleStateChange(Office._CustomTaskPane CustomTaskPaneInst)
 {
     
 }
Example #14
0
 private void commandBarBtn_Click(Office.CommandBarButton Ctrl, ref bool CancelDefault)
 {
     textBoxEvents.BeginInvoke(_updateDelegate, new object[] { "Click called." });
     Ctrl.Dispose();
 }
Example #15
0
 public Font(Office.Font2 font, Func<object> parentInvoke)
 {
     this.font = font;
     this.parentInvoke = parentInvoke;
 }