コード例 #1
0
        private void Run(string officeAppName)
        {
            try
            {
                _wait = true;
                ShowWaitPanel(true);

                treeViewOfficeUI.Nodes.Clear();

                _officeApplication           = new ApplicationWrapper(officeAppName);
                buttonCloseOfficeApp.Enabled = true;
                foreach (OfficeApi.CommandBar commandBar in _officeApplication.CommandBars)
                {
                    string   itemName = commandBar.Name;
                    TreeNode node     = treeViewOfficeUI.Nodes.Add(itemName);
                    _waitControl.ReportProgress(itemName);
                    node.ImageIndex = 0;
                    node.Tag        = commandBar;
                    node.Nodes.Add("#stub");
                }
            }
            catch (Exception exception)
            {
                throw exception;
            }
            finally
            {
                HideWaitPanel();
                _wait = false;
            }
        }
コード例 #2
0
 private void DisposeCurrentOpenOfficeApplication()
 {
     if (null != _officeApplication)
     {
         _officeApplication.Quit();
         _officeApplication.Dispose();
         _officeApplication = null;
     }
     buttonCloseOfficeApp.Enabled     = false;
     propertyGridItems.SelectedObject = null;
     treeViewOfficeUI.Nodes.Clear();
 }
コード例 #3
0
        private void Run(string officeAppName)
        {
            try
            {
                _wait = true;
                ShowWaitPanel(true);

                treeViewOfficeUI.Nodes.Clear();

                _officeApplication = new ApplicationWrapper(officeAppName);
                buttonCloseOfficeApp.Enabled = true;
                foreach (OfficeApi.CommandBar commandBar in _officeApplication.CommandBars)
                {
                    string itemName = commandBar.Name;
                    TreeNode node = treeViewOfficeUI.Nodes.Add(itemName);
                    _waitControl.ReportProgress(itemName);
                    node.ImageIndex = 0;
                    node.Tag = commandBar;
                    node.Nodes.Add("#stub");
                }
            }
            catch (Exception exception)
            {
                throw exception;
            }
            finally
            {
                HideWaitPanel();
                _wait = false;
            }
        }
コード例 #4
0
 private void DisposeCurrentOpenOfficeApplication()
 {
     if (null != _officeApplication)
     {
         _officeApplication.Quit();
         _officeApplication.Dispose();
         _officeApplication = null;
     }
     buttonCloseOfficeApp.Enabled = false;
     propertyGridItems.SelectedObject = null;
     treeViewOfficeUI.Nodes.Clear();
 }