Esempio 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;
		}
Esempio 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();
		}
Esempio 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;
		}