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


C# DockPanel.DocumentsToArray方法代码示例

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


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

示例1: CloseAllDocuments

 private static void CloseAllDocuments(DockPanel panel)
 {
     if (panel.DocumentStyle == DocumentStyle.SystemMdi)
     {
         throw new InvalidOperationException("cannot work in System MDI mode");
     }
     
     IDockContent[] documents = panel.DocumentsToArray();
     foreach (IDockContent content in documents)
     {
         content.DockHandler.Close();
     }
 }
开发者ID:moljac,项目名称:MonoMobile.SharpSNMP,代码行数:13,代码来源:DocumentPanel.cs

示例2: ShowAsDocumentTabNotPane

//		protected override void OnLoad(EventArgs e) {
//			if (base.ShowHint == DockState.Float) {
//				//base.Size = this.FloatWindowRecommendedSize;
//				this.Width = this.FloatWindowRecommendedSize.Width;
//				this.Height = this.FloatWindowRecommendedSize.Height;
//				base.FloatPane.ClientSize = this.FloatWindowRecommendedSize; 
//				Size a = base.FloatPane.PreferredSize; 
//				base.FloatPane.Size = this.FloatWindowRecommendedSize;
//			}
//		}
//		protected override void OnActivated(EventArgs e) {
//			if (base.ShowHint == DockState.Float) {
//				//base.Size = this.FloatWindowRecommendedSize;
//				this.Width = this.FloatWindowRecommendedSize.Width;
//				this.Height = this.FloatWindowRecommendedSize.Height;
//				base.FloatPane.ClientSize = this.FloatWindowRecommendedSize; 
//				Size a = base.FloatPane.PreferredSize; 
//				base.FloatPane.Size = this.FloatWindowRecommendedSize; 
//			}
//		}
//		public new void Show(DockPanel dp) {
//			if (base.ShowHint == DockState.Float) {
//				//base.Size = this.FloatWindowRecommendedSize;
//				this.Width = this.FloatWindowRecommendedSize.Width;
//				this.Height = this.FloatWindowRecommendedSize.Height;
//				//base.FloatPane.ClientSize = this.FloatWindowRecommendedSize; 
//				//Size a = base.FloatPane.PreferredSize; 
//				//base.FloatPane.Size = this.FloatWindowRecommendedSize; 
//			}
//			base.Show(dp);
//		}
		//http://msdn.microsoft.com/en-us/library/86faxx0d(v=vs.110).aspx
//			Application.ApplicationExit += new EventHandler(Application_ApplicationExit);
//		public bool ApplicationExitOccured = false;
//		void Application_ApplicationExit(object sender, EventArgs e) {
//			this.ApplicationExitOccured = true;
//		}
//		
//		public bool IsClosing = false;
//		protected override void OnClosing(System.ComponentModel.CancelEventArgs e) {
//			this.IsClosing = true;
//			base.OnClosing(e);
//		}		
//
//		// too late for ExceptionsControl.Splitter*.Distance to serialize
//		public bool IsFormClosing = false;
//		protected override void OnFormClosing(System.Windows.Forms.FormClosingEventArgs e) {
//			this.IsFormClosing = true;
//			base.OnFormClosing(e);
//		}
//		
//		public bool IsFormClosed = false;
//		protected override void OnFormClosed(System.Windows.Forms.FormClosedEventArgs e) {
//			this.IsFormClosed = true;
//			base.OnFormClosed(e);
//		}
		
		public void ShowAsDocumentTabNotPane(DockPanel dockPanel) {
			var docs = dockPanel.DocumentsToArray();
			if (docs.Length == 0) {
				this.Show(dockPanel, DockState.Document);
				return;
			}
			// add new tab, not a new pane besides existing one
			foreach (IDockContent doc in docs) {
				var hopefullyDockContent = doc as DockContent;
				if (hopefullyDockContent == null) continue; 
				this.Show(hopefullyDockContent.Pane, null);
				return;
			}
			this.Show(dockPanel, DockState.Document);
		}
开发者ID:sanyaade-fintechnology,项目名称:SquareOne,代码行数:72,代码来源:DockContentImproved.cs


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