当前位置: 首页>>代码示例>>C#>>正文


C# NetOffice.Dispose方法代码示例

本文整理汇总了C#中NetOffice.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# NetOffice.Dispose方法的具体用法?C# NetOffice.Dispose怎么用?C# NetOffice.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NetOffice的用法示例。


在下文中一共展示了NetOffice.Dispose方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: commandBarBtn_ClickEvent

 /// <summary>
 /// Click event trigger from created buttons. incoming call comes from word application thread.
 /// </summary>
 /// <param name="Ctrl"></param>
 /// <param name="CancelDefault"></param>
 void commandBarBtn_ClickEvent(NetOffice.OfficeApi.CommandBarButton Ctrl, ref bool CancelDefault)
 {
     string message = string.Format("Click from Button {0}.", Ctrl.Caption);
     MessageBox.Show(message, _progId, MessageBoxButtons.OK, MessageBoxIcon.Information);
     Ctrl.Dispose();
 }
开发者ID:netintellect,项目名称:NetOffice,代码行数:11,代码来源:Addin.cs

示例2: Application_SheetSelectionChangeEvent

        /// <summary>
        /// This method was called from the host instance after selection changed.
        /// </summary>
        /// <param name="selectedRange">active selection</param>
        private void Application_SheetSelectionChangeEvent(NetOffice.COMObject sh, Excel.Range selectedRange)
        {
            try
            {
                // we check for auto translation and skip selections with more than 256 cells for this simple example
                if (checkBoxAutoTranslate.Checked && selectedRange.Count <= 256)
                {
                    ClearError();
                    textBoxTranslation.Text = string.Empty;
                    foreach (var item in selectedRange)
                    {
                        string requestedText = item.Text as string;
                        if (!String.IsNullOrWhiteSpace(requestedText))
                        {
                            string translatedText = Client.DataService.Translate(
                                                         comboBoxSourceLanguage.SelectedItem as string,
                                                         comboBoxTargetLanguage.SelectedItem as string,
                                                         requestedText);
                            textBoxTranslation.Text += translatedText + " ";
                        }
                    }
                }

                sh.Dispose();
                selectedRange.Dispose();
            }
            catch (Exception exception)
            {
                ShowError(string.Format("An errror occured. Details: {0}", exception.Message));
            }
        }
开发者ID:swatt6400,项目名称:NetOffice,代码行数:35,代码来源:TranslationPane.cs

示例3: Application_WindowSelectionChangeEvent

 void Application_WindowSelectionChangeEvent(NetOffice.WordApi.Selection Sel)
 {
     try
     {
         if (checkBoxAutoSearch.Checked)
         {
             textBoxKeyWords.Text = Sel.Text.Replace("\r", "");
             buttonSearch_Click(buttonSearch, new EventArgs());
         }
         Sel.Dispose();
     }
     catch (Exception exception)
     {
         DisplayError(exception);
     }
 }
开发者ID:vnkolt,项目名称:NetOffice,代码行数:16,代码来源:WikipediaPane.cs

示例4: commandBarBtn_ClickEvent

 /// <summary>
 /// Click event trigger from created buttons. incoming call comes from excel application thread.
 /// </summary>
 /// <param name="Ctrl"></param>
 /// <param name="CancelDefault"></param>
 private void commandBarBtn_ClickEvent(NetOffice.OfficeApi.CommandBarButton Ctrl, ref bool CancelDefault)
 {
     try
     {
         string message = string.Format("Click from Button {0}.", Ctrl.Caption);
         MessageBox.Show(message, _progId, MessageBoxButtons.OK, MessageBoxIcon.Information);
         Ctrl.Dispose();
     }
     catch (Exception exception)
     {
         string message = string.Format("An error occured.{0}{0}{1}", Environment.NewLine, exception.Message);
         MessageBox.Show(message, _progId, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
开发者ID:vnkolt,项目名称:NetOffice,代码行数:19,代码来源:Addin.cs

示例5: powerApplication_PresentationCloseEvent

 void powerApplication_PresentationCloseEvent(NetOffice.PowerPointApi.Presentation Pres)
 {
    _presentationClose = true;
     Pres.Dispose();
 }
开发者ID:netintellect,项目名称:NetOffice,代码行数:5,代码来源:Test05.cs

示例6: powerApplication_AfterNewPresentationEvent

 void powerApplication_AfterNewPresentationEvent(NetOffice.PowerPointApi.Presentation Pres)
 {
     _afterNewPresentation = true;
     Pres.Dispose();
 }
开发者ID:netintellect,项目名称:NetOffice,代码行数:5,代码来源:Test05.cs

示例7: powerApplication_AfterNewPresentationEvent

 private void powerApplication_AfterNewPresentationEvent(NetOffice.PowerPointApi.Presentation Pres)
 {
     textBoxEvents.BeginInvoke(_updateDelegate, new object[] { "Event AfterNewPresentation called." });
     Pres.Dispose();
 }
开发者ID:swatt6400,项目名称:NetOffice,代码行数:5,代码来源:Example06.cs

示例8: wordApplication_NewDocumentEvent

 void wordApplication_NewDocumentEvent(NetOffice.WordApi.Document Doc)
 {
     _newDocumentCalled = true;
     Doc.Dispose();
 }
开发者ID:vnkolt,项目名称:NetOffice,代码行数:5,代码来源:Test06.cs

示例9: wordApplication_DocumentBeforeCloseEvent

 void wordApplication_DocumentBeforeCloseEvent(NetOffice.WordApi.Document Doc, ref bool Cancel)
 {
     _beforeCloseCalled = true;
     Doc.Dispose();
 }
开发者ID:vnkolt,项目名称:NetOffice,代码行数:5,代码来源:Test06.cs

示例10: wordApplication_NewDocumentEvent

 void wordApplication_NewDocumentEvent(NetOffice.WordApi.Document Doc)
 {
     textBoxEvents.BeginInvoke(_updateDelegate, new object[] { "Event NewDocumentEvent called." });
     Doc.Dispose();
 }
开发者ID:vnkolt,项目名称:NetOffice,代码行数:5,代码来源:Example06.cs

示例11: wordApplication_DocumentBeforeCloseEvent

 void wordApplication_DocumentBeforeCloseEvent(NetOffice.WordApi.Document Doc, ref bool Cancel)
 {
     textBoxEvents.BeginInvoke(_updateDelegate, new object[] { "Event DocumentBeforeClose called." });
     Doc.Dispose();
 }
开发者ID:vnkolt,项目名称:NetOffice,代码行数:5,代码来源:Example06.cs


注:本文中的NetOffice.Dispose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。