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


C# Microsoft.Close方法代码示例

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


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

示例1: Map

        private CalendarItem Map(Microsoft.Office.Interop.Outlook.AppointmentItem item)
        {
            var calItem = new CalendarItem()
            {
                End = item.End,
                Id = item.GlobalAppointmentID,
                ItemId = item.GlobalAppointmentID,
                Start = item.Start,
                Summary = item.Subject,
                Location = item.Location,
                Organizer = item.Organizer,
                Created = item.CreationTime,
                Description = item.Body,
                Attendees = item.Recipients.OfType<Microsoft.Office.Interop.Outlook.Recipient>().Select(x => new Attendee() { DisplayName = x.Name, Email = GetEmailOfRecipient(x), Optional = x.Type == 2 }).ToList(),
                Locked = true,
                Status = item.BusyStatus.ToString(),
                Reminders = new List<Reminder> { new Reminder { Method = "popup", Minutes = item.ReminderMinutesBeforeStart } },
                //Recurrence = GetRecurrence(item),
                IsRecurring = item.IsRecurring,
                CalendarId = item.GlobalAppointmentID
            };

            item.Close(Microsoft.Office.Interop.Outlook.OlInspectorClose.olDiscard);
            return calItem;
        }
开发者ID:Ahrimaan,项目名称:ChaosCalendarSync,代码行数:25,代码来源:OutlookAccess.cs

示例2: Dispose

        /// <summary>
        /// 释放内存
        /// </summary>
        public void Dispose(Microsoft.Office.Interop.Excel._Worksheet CurSheet, Microsoft.Office.Interop.Excel._Workbook CurBook, Microsoft.Office.Interop.Excel._Application CurExcel)
        {
            try
            {
                System.Runtime.InteropServices.Marshal.ReleaseComObject(CurSheet);
                CurSheet = null;
                CurBook.Close(false, mValue, mValue);
                System.Runtime.InteropServices.Marshal.ReleaseComObject(CurBook);
                CurBook = null;

                CurExcel.Quit();
                System.Runtime.InteropServices.Marshal.ReleaseComObject(CurExcel);
                CurExcel = null;

                GC.Collect();
                GC.WaitForPendingFinalizers();
            }
            catch (System.Exception ex)
            {
                // HttpContext.Current.Response.Write("在释放Excel内存空间时发生了一个错误:" + ex);
            }
            finally
            {
                foreach (System.Diagnostics.Process pro in System.Diagnostics.Process.GetProcessesByName("Excel"))
                    //if (pro.StartTime < DateTime.Now)
                    pro.Kill();
            }
            System.GC.SuppressFinalize(this);
        }
开发者ID:smartbooks,项目名称:SmartUtility,代码行数:32,代码来源:ExcelOperate.cs

示例3: CloseThreadHandle

 private static void CloseThreadHandle(Microsoft.Win32.SafeHandles.SafeThreadHandle handle)
 {
     if (handle != null)
     {
         handle.Close();
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:ProcessThread.cs

示例4: ReleaseObjects

        private void ReleaseObjects(Microsoft.Office.Interop.PowerPoint.Presentation _objPresentation, Application _objApplication)
        {
            GC.Collect();
            GC.WaitForPendingFinalizers();

            if (_objPresentation != null)
            {
                _objPresentation.Close();
                //Marshal.FinalReleaseComObject(_objPresentation);
            }

            if (_objApplication != null)
            {
                _objApplication.Quit();
                //Marshal.FinalReleaseComObject(_objApplication);
            }

            System.Diagnostics.Process[] pros = System.Diagnostics.Process.GetProcessesByName("POWERPNT");
            for (int i = 0; i < pros.Length; i++)
            {
                pros[i].Kill();
            }
        }
开发者ID:wuqingman,项目名称:ppt-generator,代码行数:23,代码来源:Presentation.cs

示例5: CloseWorkBook

		void CloseWorkBook(Microsoft.Office.Interop.Excel.Workbook ExcelWb, String TargetDirectory, String SaveName)
			{
			String ExcelFileName = Path.Combine(TargetDirectory, SaveName);
			if (File.Exists(ExcelFileName))
				File.Delete(ExcelFileName);
			ExcelWb.SaveAs(ExcelFileName, Microsoft.Office.Interop.Excel.XlFileFormat.xlWorkbookDefault, Missing.Value,
				Missing.Value, Missing.Value, Missing.Value, Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlNoChange,
				Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);
			ExcelWb.Close(Missing.Value, Missing.Value, Missing.Value);
			ExcelApplication.Quit();
			ExcelWb = null;
			ExcelApplication = null;

			}
开发者ID:heinzsack,项目名称:DEV,代码行数:14,代码来源:ExcelFunctions.cs

示例6: CloseReadWorkbook

		public void CloseReadWorkbook(Microsoft.Office.Interop.Excel.Workbook ExcelWb)
			{
			ExcelWb.Close(Missing.Value, Missing.Value, Missing.Value);
			ExcelApplication.Quit();
			ExcelWb = null;
			ExcelApplication = null;
			}
开发者ID:heinzsack,项目名称:DEV,代码行数:7,代码来源:ExcelFunctions.cs

示例7: ReleaseProcessHandle

 private void ReleaseProcessHandle(Microsoft.Win32.SafeHandles.SafeProcessHandle handle)
 {
     if ((handle != null) && (!this.haveProcessHandle || (handle != this.m_processHandle)))
     {
         handle.Close();
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:Process.cs

示例8: SaveDocument

 private void SaveDocument(Microsoft.Office.Interop.Word.Document wordDocument, Microsoft.Office.Interop.Word.ApplicationClass wordApp, string filePath)
 {
     object Visible = false;
     object missing = System.Reflection.Missing.Value;
     Object Nothing = System.Reflection.Missing.Value;
     object Save_FileName = filePath;
     //保存模板文件
     wordDocument.SaveAs(ref Save_FileName, ref missing, ref missing, ref missing, ref missing,
        ref missing, ref missing, ref missing, ref Visible,
        ref missing, ref missing, ref missing, ref missing, ref missing, ref missing,
        ref missing);
     //关闭wordDoc文档对象
     wordDocument.Close(ref Nothing, ref Nothing, ref Nothing);
     wordDocument = null;
     //关闭wordApp组件对象
     wordApp.Quit(ref Nothing, ref Nothing, ref Nothing);
 }
开发者ID:rbmyself,项目名称:ipmsnew,代码行数:17,代码来源:Export.asmx.cs


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