Ejemplo n.º 1
0
		public void DockPanel(FloatPanel panel)
		{
			if (DockSuggestion == null) return;

			panel.SuspendLayout();
			_form.SuspendLayout();
			if (DockSuggestion.LayoutSplit != null)
			{
				var panelSize = panel.Size;
				var multiSplitParent = DockSuggestion.LayoutSplit.Parent as MultiSplitContainer;

				if (multiSplitParent != null)
				{
					AddPanelToSplitContainer(multiSplitParent, panel.ChildPanel, DockSuggestion.LayoutSplit.Index);
				}
			}
			else if (DockSuggestion.JoinPanel is IdeGroupedPanel groupedPanel)
			{
				groupedPanel.AddPanel(panel.ChildPanel, true);
			}
			else
			{
				JoinPanels(DockSuggestion.JoinPanel, panel.ChildPanel);
			}
			_form.ResumeLayout();
			panel.ResumeLayout();
			panel.Close();
			panel.Dispose();

			_form.Focus();
			DockSuggestion = null;
		}
Ejemplo n.º 2
0
		protected void CreateFloatPanel(IdePanel panel, Point? location = null, Size? size = null)
		{
			var floatPanel = new FloatPanel(this);
			floatPanel.SuspendLayout();
			floatPanel.SetChildPanel(panel);
			floatPanel.Show(_form);

			if (location.HasValue) floatPanel.Location = location.Value;
			if (size.HasValue) floatPanel.Size = size.Value;
			floatPanel.ResumeLayout();
		}
Ejemplo n.º 3
0
		public void SuggestDock(Point cursorPosition, FloatPanel activePanel)
		{
			foreach (var floatPanel in Application.OpenForms.OfType<FloatPanel>().Where(p => p != activePanel))
			{
				if (CheckGroupDock(floatPanel.ChildPanel)) return;
			}
			foreach (var container in DockContainers)
			{
				if (CheckDockLocation(container)) return;
			}
			DockSuggestion = null;
		}