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


C# IViewContent.Dispose方法代码示例

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


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

示例1: ForceInitializeView

		/// <summary>
		/// Forces initialization of the specified view.
		/// </summary>
		public virtual void ForceInitializeView(IViewContent view)
		{
			if (view == null)
				throw new ArgumentNullException("view");
			
			try {
				if (currentView != view) {
					if (currentView == null) {
						SwitchedToView(view);
					} else {
						try {
							inLoadOperation = true;
							using (Stream sourceStream = OpenRead()) {
								view.Load(this, sourceStream);
							}
						} finally {
							inLoadOperation = false;
						}
					}
				}
			} catch (Exception) {
				view.Dispose();
				throw;
			}
		}
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:28,代码来源:OpenedFile.cs

示例2: CloseContent

		public void CloseContent(IViewContent content)
		{
			if (PropertyService.Get("SharpDevelop.LoadDocumentProperties", true) && content is IMementoCapable) {
				StoreMemento(content);
			}
			if (primaryViewContentCollection.Contains(content)) {
				primaryViewContentCollection.Remove(content);
			}
			OnViewClosed(new ViewContentEventArgs(content));
			content.Dispose();
			content = null;
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:12,代码来源:DefaultWorkbench.cs

示例3: CloseView

		public void CloseView(IViewContent content)
		{
			bool tempProperties = propertyService.GetProperty("NetFocus.DataStructure.LoadDocumentProperties", true);
			if (tempProperties && content is IMementoCapable) 
			{
				workbench.StoreMemento(content);
			}
			workbench.ViewContentCollection.Remove(content);

			content.Dispose();
			
		}
开发者ID:tangxuehua,项目名称:DataStructure,代码行数:12,代码来源:SdiWorkbenchLayout.cs

示例4: CloseContent

		public void CloseContent(IViewContent content)
		{
			if (views.Contains(content)) {
				views.Remove(content);
			}
			
			content.Dispose();
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:8,代码来源:Workbench.cs

示例5: CloseView

 public virtual void CloseView(IViewContent content)
 {
     if (ViewContentCollection.Contains(content))
     {
         ViewContentCollection.Remove(content);
     }
     content.Dispose();
     content = null;
 }
开发者ID:jiangguang5201314,项目名称:DotNetFramework,代码行数:9,代码来源:DefaultWorkbench.cs

示例6: ForceInitializeView

        /// <summary>
        /// Forces initialization of the specified view.
        /// </summary>
        public virtual void ForceInitializeView(IViewContent view)
        {
            if (view == null)
                throw new ArgumentNullException("view");

            bool success = false;
            try {
                if (currentView != view) {
                    if (currentView == null) {
                        SwitchedToView(view);
                    } else {
                        try {
                            inLoadOperation = true;
                            using (Stream sourceStream = OpenRead()) {
                                view.Load(this, sourceStream);
                            }
                        } finally {
                            inLoadOperation = false;
                        }
                    }
                }
                success = true;
            } finally {
                // Only in case of exceptions:
                // (try-finally with bool is better than try-catch-rethrow because it causes the debugger to stop
                // at the original error location, not at the rethrow)
                if (!success) {
                    view.Dispose();
                }
            }
        }
开发者ID:fanyjie,项目名称:SharpDevelop,代码行数:34,代码来源:OpenedFile.cs

示例7: CloseContent

 public void CloseContent(IViewContent content)
 {
     if (PropertyService.Get<bool>("SharpDevelop.LoadDocumentProperties", true) && (content is IMementoCapable))
     {
         this.StoreMemento(content);
     }
     if (this.ViewContentCollection.Contains(content))
     {
         this.ViewContentCollection.Remove(content);
     }
     this.OnViewClosed(new ViewContentEventArgs(content));
     content.Dispose();
     if (content.WorkbenchWindow != null)
     {
         content.WorkbenchWindow.CloseWindow(false);
     }
     content = null;
 }
开发者ID:vanloc0301,项目名称:mychongchong,代码行数:18,代码来源:DefaultWorkbench.cs


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