public LayoutRoot() { this.RightSide = new LayoutAnchorSide(); this.LeftSide = new LayoutAnchorSide(); this.TopSide = new LayoutAnchorSide(); this.BottomSide = new LayoutAnchorSide(); this.RootPanel = new LayoutPanel(new LayoutDocumentPane()); }
public LayoutRoot() { RightSide = new LayoutAnchorSide(); LeftSide = new LayoutAnchorSide(); TopSide = new LayoutAnchorSide(); BottomSide = new LayoutAnchorSide(); RootPanel = new LayoutPanel(new LayoutDocumentPane()); }
public void ReadXml(XmlReader reader) { reader.MoveToContent(); if (reader.IsEmptyElement) { reader.Read(); return; } var layoutPanelElements = ReadRootPanel(reader); if (layoutPanelElements != null) { RootPanel = new LayoutPanel(); //Add all children to RootPanel for (int i = 0; i < layoutPanelElements.Count; ++i) { RootPanel.Children.Add(layoutPanelElements[i]); } } TopSide = new LayoutAnchorSide(); if (ReadElement(reader) != null) { FillLayoutAnchorSide(reader, TopSide); } RightSide = new LayoutAnchorSide(); if (ReadElement(reader) != null) { FillLayoutAnchorSide(reader, RightSide); } LeftSide = new LayoutAnchorSide(); if (ReadElement(reader) != null) { FillLayoutAnchorSide(reader, LeftSide); } BottomSide = new LayoutAnchorSide(); if (ReadElement(reader) != null) { FillLayoutAnchorSide(reader, BottomSide); } FloatingWindows.Clear(); var floatingWindows = ReadElementList(reader); foreach (var floatingWindow in floatingWindows) { FloatingWindows.Add(( LayoutFloatingWindow )floatingWindow); } Hidden.Clear(); var hidden = ReadElementList(reader); foreach (var hiddenObject in hidden) { Hidden.Add(( LayoutAnchorable )hiddenObject); } }
public void JustDecompileGenerated_set_BottomSide(LayoutAnchorSide value) { if (this._bottomSide != value) { this.RaisePropertyChanging("BottomSide"); this._bottomSide = value; if (this._bottomSide != null) { this._bottomSide.Parent = this; } this.RaisePropertyChanged("BottomSide"); } }
public void ReplaceChild(ILayoutElement oldElement, ILayoutElement newElement) { if (oldElement == this.RootPanel) { this.RootPanel = (LayoutPanel)newElement; return; } if (this._floatingWindows != null && this._floatingWindows.Contains(oldElement)) { int num = this._floatingWindows.IndexOf(oldElement as LayoutFloatingWindow); this._floatingWindows.Remove(oldElement as LayoutFloatingWindow); this._floatingWindows.Insert(num, newElement as LayoutFloatingWindow); return; } if (this._hiddenAnchorables != null && this._hiddenAnchorables.Contains(oldElement)) { int num1 = this._hiddenAnchorables.IndexOf(oldElement as LayoutAnchorable); this._hiddenAnchorables.Remove(oldElement as LayoutAnchorable); this._hiddenAnchorables.Insert(num1, newElement as LayoutAnchorable); return; } if (oldElement == this.TopSide) { this.TopSide = (LayoutAnchorSide)newElement; return; } if (oldElement == this.RightSide) { this.RightSide = (LayoutAnchorSide)newElement; return; } if (oldElement == this.BottomSide) { this.BottomSide = (LayoutAnchorSide)newElement; return; } if (oldElement == this.LeftSide) { this.LeftSide = (LayoutAnchorSide)newElement; } }
public void RemoveChild(ILayoutElement element) { if (element == this.RootPanel) { this.RootPanel = null; return; } if (this._floatingWindows != null && this._floatingWindows.Contains(element)) { this._floatingWindows.Remove(element as LayoutFloatingWindow); return; } if (this._hiddenAnchorables != null && this._hiddenAnchorables.Contains(element)) { this._hiddenAnchorables.Remove(element as LayoutAnchorable); return; } if (element == this.TopSide) { this.TopSide = null; return; } if (element == this.RightSide) { this.RightSide = null; return; } if (element == this.BottomSide) { this.BottomSide = null; return; } if (element == this.LeftSide) { this.LeftSide = null; } }
private void FillLayoutAnchorSide(XmlReader reader, LayoutAnchorSide layoutAnchorSide) { var result = new List <LayoutAnchorGroup>(); while (true) { //Read all layoutAnchorSide children var element = ReadElement(reader) as LayoutAnchorGroup; if (element != null) { result.Add(element); } else if (reader.NodeType == XmlNodeType.EndElement) { break; } } reader.ReadEndElement(); foreach (var las in result) { layoutAnchorSide.Children.Add(las); } }
public void ToggleAutoHide() { LayoutAnchorable[] array; int i; Func <ILayoutPreviousContainer, bool> func = null; if (!this.IsAutoHidden) { if (base.Parent is LayoutAnchorablePane) { ILayoutRoot root = base.Root; LayoutAnchorablePane parent = base.Parent as LayoutAnchorablePane; LayoutAnchorGroup layoutAnchorGroup = new LayoutAnchorGroup(); ((ILayoutPreviousContainer)layoutAnchorGroup).PreviousContainer = parent; array = parent.Children.ToArray <LayoutAnchorable>(); for (i = 0; i < (int)array.Length; i++) { LayoutAnchorable layoutAnchorable = array[i]; layoutAnchorGroup.Children.Add(layoutAnchorable); } switch (parent.GetSide()) { case AnchorSide.Left: { root.LeftSide.Children.Add(layoutAnchorGroup); return; } case AnchorSide.Top: { root.TopSide.Children.Add(layoutAnchorGroup); return; } case AnchorSide.Right: { root.RightSide.Children.Add(layoutAnchorGroup); return; } case AnchorSide.Bottom: { root.BottomSide.Children.Add(layoutAnchorGroup); break; } default: { return; } } } return; } LayoutAnchorGroup parent1 = base.Parent as LayoutAnchorGroup; LayoutAnchorSide layoutAnchorSide = parent1.Parent as LayoutAnchorSide; LayoutAnchorablePane previousContainer = ((ILayoutPreviousContainer)parent1).PreviousContainer as LayoutAnchorablePane; if (previousContainer != null) { IEnumerable <ILayoutPreviousContainer> layoutPreviousContainers = (parent1.Root as LayoutRoot).Descendents().OfType <ILayoutPreviousContainer>(); Func <ILayoutPreviousContainer, bool> func1 = func; if (func1 == null) { Func <ILayoutPreviousContainer, bool> previousContainer1 = (ILayoutPreviousContainer c) => c.PreviousContainer == parent1; Func <ILayoutPreviousContainer, bool> func2 = previousContainer1; func = previousContainer1; func1 = func2; } foreach (ILayoutPreviousContainer layoutPreviousContainer in layoutPreviousContainers.Where <ILayoutPreviousContainer>(func1)) { layoutPreviousContainer.PreviousContainer = previousContainer; } } else { switch ((parent1.Parent as LayoutAnchorSide).Side) { case AnchorSide.Left: { if (parent1.Root.RootPanel.Orientation != Orientation.Horizontal) { previousContainer = new LayoutAnchorablePane(); LayoutPanel layoutPanel = new LayoutPanel() { Orientation = Orientation.Horizontal }; LayoutRoot layoutRoot = parent1.Root as LayoutRoot; LayoutPanel rootPanel = parent1.Root.RootPanel; layoutRoot.RootPanel = layoutPanel; layoutPanel.Children.Add(previousContainer); layoutPanel.Children.Add(rootPanel); break; } else { previousContainer = new LayoutAnchorablePane() { DockMinWidth = this.AutoHideMinWidth }; parent1.Root.RootPanel.Children.Insert(0, previousContainer); break; } } case AnchorSide.Top: { if (parent1.Root.RootPanel.Orientation != Orientation.Vertical) { previousContainer = new LayoutAnchorablePane(); LayoutPanel layoutPanel1 = new LayoutPanel() { Orientation = Orientation.Vertical }; LayoutRoot root1 = parent1.Root as LayoutRoot; LayoutPanel rootPanel1 = parent1.Root.RootPanel; root1.RootPanel = layoutPanel1; layoutPanel1.Children.Add(previousContainer); layoutPanel1.Children.Add(rootPanel1); break; } else { previousContainer = new LayoutAnchorablePane() { DockMinHeight = this.AutoHideMinHeight }; parent1.Root.RootPanel.Children.Insert(0, previousContainer); break; } } case AnchorSide.Right: { if (parent1.Root.RootPanel.Orientation != Orientation.Horizontal) { previousContainer = new LayoutAnchorablePane(); LayoutPanel layoutPanel2 = new LayoutPanel() { Orientation = Orientation.Horizontal }; LayoutRoot layoutRoot1 = parent1.Root as LayoutRoot; LayoutPanel rootPanel2 = parent1.Root.RootPanel; layoutRoot1.RootPanel = layoutPanel2; layoutPanel2.Children.Add(rootPanel2); layoutPanel2.Children.Add(previousContainer); break; } else { previousContainer = new LayoutAnchorablePane() { DockMinWidth = this.AutoHideMinWidth }; parent1.Root.RootPanel.Children.Add(previousContainer); break; } } case AnchorSide.Bottom: { if (parent1.Root.RootPanel.Orientation != Orientation.Vertical) { previousContainer = new LayoutAnchorablePane(); LayoutPanel layoutPanel3 = new LayoutPanel() { Orientation = Orientation.Vertical }; LayoutRoot root2 = parent1.Root as LayoutRoot; LayoutPanel rootPanel3 = parent1.Root.RootPanel; root2.RootPanel = layoutPanel3; layoutPanel3.Children.Add(rootPanel3); layoutPanel3.Children.Add(previousContainer); break; } else { previousContainer = new LayoutAnchorablePane() { DockMinHeight = this.AutoHideMinHeight }; parent1.Root.RootPanel.Children.Add(previousContainer); break; } } } } array = parent1.Children.ToArray <LayoutAnchorable>(); for (i = 0; i < (int)array.Length; i++) { LayoutAnchorable layoutAnchorable1 = array[i]; previousContainer.Children.Add(layoutAnchorable1); } layoutAnchorSide.Children.Remove(parent1); }