internal void CopyPropToDockForm(DockForm form) { form.AllowDock = this.allowDock; form.FormBorderStyle = this.FormBorderStyle; form.Icon = this.Icon; form.Text = this.Text; }
/// <summary> /// Reads the complete hierarchy from a file. /// </summary> /// <param name="file">The source XML file.</param> public static void ReadXml(string file) { XmlTextReader reader = null; try { // Load the reader with the data file and ignore all white space nodes. reader = new XmlTextReader(file); reader.WhitespaceHandling = WhitespaceHandling.None; // Parse the file and display each of the nodes. while (reader.Read()) { if (!reader.IsStartElement()) { continue; } switch (reader.Name) { case "form": Console.WriteLine("form"); DockForm form = new DockForm(); form.Opacity = 0; form.Show(); form.ReadXml(reader.ReadSubtree()); //if (!form.RootContainer.IsEmpty) form.Opacity = 1; //else // form.Close(); break; case "manager": Console.WriteLine("manager"); string hostType = reader.GetAttribute("parent"); if (hostType != null) { foreach (DockManager m in managerList) { if (m.Parent.GetType().FullName == hostType) { m.ReadXml(reader.ReadSubtree()); } } } break; } } } finally { if (reader != null) { reader.Close(); } } }
internal static void UnRegisterForm(DockForm form) { if (!formList.Contains(form)) { return; } formList.Remove(form); }
internal void CopyToDockForm(DockForm form) { form.Location = this.Location; form.Size = this.Size; form.RootContainer.Controls.Add(controlContainer); form.RootContainer.DockType = this.DockType; CopyPropToDockForm(form); }
private void LoadDockForm() { DockForm form = new DockForm(); CopyToDockForm(form); if (showFormAtOnLoad) { form.Show(); } }
internal static void FormActivated(DockForm form) { // Update Z-Order. if (!formList.Contains(form)) { return; } formList.Remove(form); formList.Insert(0, form); }
internal static DockForm GetFormAtPoint(Point pt, int startIndex) { for (int i = startIndex; i < formList.Count; i++) { DockForm f = formList[i] as DockForm; if (f.Bounds.Contains(pt) & f.Visible) { return(f); } } return(null); }
internal static void RegisterForm(DockForm form) { if (formList.Contains(form)) { return; } if (form == null) { throw new ArgumentNullException("The form must not be null."); } form.Disposed += new EventHandler(ObjectDisposed); formList.Add(form); }
private void FloatWindow() { Rectangle rc = RectangleToScreen(this.ClientRectangle); DockForm form = new DockForm(dragObject); form.Show(); form.Location = new Point(MousePosition.X, MousePosition.Y); if (!DockManager.FastMoveDraw) form.Opacity = 1; form.StartMoving(new Point(MousePosition.X + 10, MousePosition.Y + 10)); dragObject = null; if ((panList.Count == 0) & (dockType == DockContainerType.Document) & (removeable) & (this.Parent is DockContainer)) (this.Parent as DockContainer).Controls.Remove(this); }
internal void SetFormSizeBounds(DockForm form) { Size minSize = Size.Empty; Size maxSize = Size.Empty; foreach (DockPanel p in panList) { if (!p.MinFormSize.IsEmpty) { if (p.MinFormSize.Width > minSize.Width) minSize.Width = p.MinFormSize.Width; if (p.MinFormSize.Height > minSize.Height) minSize.Height = p.MinFormSize.Height; } if (!p.MaxFormSize.IsEmpty) { if (p.MaxFormSize.Width < maxSize.Width) maxSize.Width = p.MaxFormSize.Width; if (p.MaxFormSize.Height < maxSize.Height) maxSize.Height = p.MaxFormSize.Height; } } try { Size paddingSize = new Size(this.Padding.Left + this.Padding.Right, this.Padding.Top + this.Padding.Bottom); if (minSize.IsEmpty) form.MinimumSize = Size.Empty; else form.MinimumSize = Size.Add(minSize, paddingSize); if (maxSize.IsEmpty) form.MaximumSize = Size.Empty; else form.MaximumSize = Size.Add(maxSize, paddingSize); } catch (Exception ex) { Console.WriteLine("DockContainer.SetFormSizeBounds : " + ex.Message); } }
private void LoadDockForm() { DockForm form = new DockForm(); CopyToDockForm(form); if (showFormAtOnLoad) form.Show(); }
internal static int GetZIndex(DockForm form) { return(formList.IndexOf(form)); }
internal static int GetZIndex(DockForm form) { return formList.IndexOf(form); }
internal static void FormActivated(DockForm form) { // Update Z-Order. if (!formList.Contains(form)) return; formList.Remove(form); formList.Insert(0, form); }
/// <summary> /// Reads the complete hierarchy from a file. /// </summary> /// <param name="file">The source XML file.</param> public static void ReadXml(string file) { XmlTextReader reader = null; try { // Load the reader with the data file and ignore all white space nodes. reader = new XmlTextReader(file); reader.WhitespaceHandling = WhitespaceHandling.None; // Parse the file and display each of the nodes. while (reader.Read()) { if (!reader.IsStartElement()) continue; switch (reader.Name) { case "form": Console.WriteLine("form"); DockForm form = new DockForm(); form.Opacity = 0; form.Show(); form.ReadXml(reader.ReadSubtree()); //if (!form.RootContainer.IsEmpty) form.Opacity = 1; //else // form.Close(); break; case "manager": Console.WriteLine("manager"); string hostType = reader.GetAttribute("parent"); if (hostType != null) { foreach (DockManager m in managerList) if (m.Parent.GetType().FullName == hostType) m.ReadXml(reader.ReadSubtree()); } break; } } } finally { if (reader != null) reader.Close(); } }
internal static void RegisterForm(DockForm form) { if (formList.Contains(form)) return; if (form == null) throw new ArgumentNullException("The form must not be null."); form.Disposed += new EventHandler(ObjectDisposed); formList.Add(form); }
internal static void UnRegisterForm(DockForm form) { if (!formList.Contains(form)) return; formList.Remove(form); }