void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.ToolBarTray = ((System.Windows.Controls.ToolBarTray)(target)); return; case 2: this.DockingManager = ((Xceed.Wpf.AvalonDock.DockingManager)(target)); return; case 3: this._layoutRoot = ((Xceed.Wpf.AvalonDock.Layout.LayoutRoot)(target)); return; case 4: this.AMLDocumentTree = ((Aml.Toolkit.View.AMLTreeView)(target)); return; case 5: this.DocumentPane = ((Xceed.Wpf.AvalonDock.Layout.LayoutDocumentPane)(target)); return; case 6: this.Floating = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorableFloatingWindow)(target)); return; case 7: this.FloatingPane = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorablePane)(target)); return; case 8: this.LeftTabSide = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorGroup)(target)); return; case 9: this.RightTabSide = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorGroup)(target)); return; case 10: this.TopTabSide = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorGroup)(target)); return; case 11: this.BottomTabSide = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorGroup)(target)); return; case 12: this.statusLabel = ((System.Windows.Controls.TextBlock)(target)); return; case 13: this.LayoutTransformSlider = ((System.Windows.Controls.Slider)(target)); return; } this._contentLoaded = true; }
/* * public void RemoveSide() * { * if (Parent is LayoutAnchorGroup) * { * ILayoutRoot root = Root; * LayoutAnchorGroup lagroup = (LayoutAnchorGroup)(Parent); * if (root.RightSide.Children.Contains(lagroup)) * { * root.RightSide.Children.Remove(lagroup); * } * if (root.LeftSide.Children.Contains(lagroup)) * { * root.LeftSide.Children.Remove(lagroup); * } * if (root.TopSide.Children.Contains(lagroup)) * { * root.TopSide.Children.Remove(lagroup); * } * if (root.BottomSide.Children.Contains(lagroup)) * { * root.BottomSide.Children.Remove(lagroup); * } * lagroup.Parent = (ILayoutContainer)(root); * } * } */ public void ReplaceSide(AnchorSide side) { if (Parent is LayoutAnchorGroup) { ILayoutRoot root = Root; LayoutAnchorGroup lagroup = (LayoutAnchorGroup)(Parent); if (root.RightSide.Children.Contains(lagroup)) { root.RightSide.Children.Remove(lagroup); } if (root.LeftSide.Children.Contains(lagroup)) { root.LeftSide.Children.Remove(lagroup); } if (root.TopSide.Children.Contains(lagroup)) { root.TopSide.Children.Remove(lagroup); } if (root.BottomSide.Children.Contains(lagroup)) { root.BottomSide.Children.Remove(lagroup); } switch (side) { case AnchorSide.Right: root.RightSide.Children.Add(lagroup); LayoutSetting.AddDefaultSideAnchorable(Title, "RIGHT"); break; case AnchorSide.Left: root.LeftSide.Children.Add(lagroup); LayoutSetting.AddDefaultSideAnchorable(Title, "LEFT"); break; case AnchorSide.Top: root.TopSide.Children.Add(lagroup); LayoutSetting.AddDefaultSideAnchorable(Title, "TOP"); break; case AnchorSide.Bottom: root.BottomSide.Children.Add(lagroup); LayoutSetting.AddDefaultSideAnchorable(Title, "BOTTOM"); break; } } }
public void ToggleAutoHide() { #region Anchorable is already auto hidden if (IsAutoHidden) { var parentGroup = Parent as LayoutAnchorGroup; var parentSide = parentGroup.Parent as LayoutAnchorSide; var previousContainer = ((ILayoutPreviousContainer)parentGroup).PreviousContainer as LayoutAnchorablePane; if (previousContainer == null) { AnchorSide side = (parentGroup.Parent as LayoutAnchorSide).Side; switch (side) { case AnchorSide.Right: if (parentGroup.Root.RootPanel.Orientation == Orientation.Horizontal) { previousContainer = new LayoutAnchorablePane(); parentGroup.Root.RootPanel.Children.Add(previousContainer); } else { previousContainer = new LayoutAnchorablePane(); LayoutPanel panel = new LayoutPanel() { Orientation = Orientation.Horizontal }; LayoutRoot root = parentGroup.Root as LayoutRoot; LayoutPanel oldRootPanel = parentGroup.Root.RootPanel as LayoutPanel; root.RootPanel = panel; panel.Children.Add(oldRootPanel); panel.Children.Add(previousContainer); } break; case AnchorSide.Left: if (parentGroup.Root.RootPanel.Orientation == Orientation.Horizontal) { previousContainer = new LayoutAnchorablePane(); parentGroup.Root.RootPanel.Children.Insert(0, previousContainer); } else { previousContainer = new LayoutAnchorablePane(); LayoutPanel panel = new LayoutPanel() { Orientation = Orientation.Horizontal }; LayoutRoot root = parentGroup.Root as LayoutRoot; LayoutPanel oldRootPanel = parentGroup.Root.RootPanel as LayoutPanel; root.RootPanel = panel; panel.Children.Add(previousContainer); panel.Children.Add(oldRootPanel); } break; case AnchorSide.Top: if (parentGroup.Root.RootPanel.Orientation == Orientation.Vertical) { previousContainer = new LayoutAnchorablePane(); parentGroup.Root.RootPanel.Children.Insert(0, previousContainer); } else { previousContainer = new LayoutAnchorablePane(); LayoutPanel panel = new LayoutPanel() { Orientation = Orientation.Vertical }; LayoutRoot root = parentGroup.Root as LayoutRoot; LayoutPanel oldRootPanel = parentGroup.Root.RootPanel as LayoutPanel; root.RootPanel = panel; panel.Children.Add(previousContainer); panel.Children.Add(oldRootPanel); } break; case AnchorSide.Bottom: if (parentGroup.Root.RootPanel.Orientation == Orientation.Vertical) { previousContainer = new LayoutAnchorablePane(); parentGroup.Root.RootPanel.Children.Add(previousContainer); } else { previousContainer = new LayoutAnchorablePane(); LayoutPanel panel = new LayoutPanel() { Orientation = Orientation.Vertical }; LayoutRoot root = parentGroup.Root as LayoutRoot; LayoutPanel oldRootPanel = parentGroup.Root.RootPanel as LayoutPanel; root.RootPanel = panel; panel.Children.Add(oldRootPanel); panel.Children.Add(previousContainer); } break; } } else { //I'm about to remove parentGroup, redirect any content (ie hidden contents) that point to it //to previousContainer LayoutRoot root = parentGroup.Root as LayoutRoot; foreach (var cnt in root.Descendents().OfType <ILayoutPreviousContainer>().Where(c => c.PreviousContainer == parentGroup)) { cnt.PreviousContainer = previousContainer; } } foreach (var anchorableToToggle in parentGroup.Children.ToArray()) { previousContainer.Children.Add(anchorableToToggle); } parentSide.Children.Remove(parentGroup); } #endregion #region Anchorable is docked else if (Parent is LayoutAnchorablePane) { var root = Root; var parentPane = Parent as LayoutAnchorablePane; var newAnchorGroup = new LayoutAnchorGroup(); ((ILayoutPreviousContainer)newAnchorGroup).PreviousContainer = parentPane; foreach (var anchorableToImport in parentPane.Children.ToArray()) { newAnchorGroup.Children.Add(anchorableToImport); } //detect anchor side for the pane var anchorSide = parentPane.GetSide(); switch (anchorSide) { case AnchorSide.Right: root.RightSide.Children.Add(newAnchorGroup); break; case AnchorSide.Left: root.LeftSide.Children.Add(newAnchorGroup); break; case AnchorSide.Top: root.TopSide.Children.Add(newAnchorGroup); break; case AnchorSide.Bottom: root.BottomSide.Children.Add(newAnchorGroup); break; } } #endregion }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: #line 6 "..\..\MainWindow.xaml" ((HerbalAnalysis.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded); #line default #line hidden #line 6 "..\..\MainWindow.xaml" ((HerbalAnalysis.MainWindow)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.Window_Closing); #line default #line hidden #line 6 "..\..\MainWindow.xaml" ((HerbalAnalysis.MainWindow)(target)).Activated += new System.EventHandler(this.Window_Activated); #line default #line hidden return; case 2: #line 8 "..\..\MainWindow.xaml" ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.NewPqxProjCommand); #line default #line hidden return; case 3: #line 9 "..\..\MainWindow.xaml" ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.OpenPqxProjCommand); #line default #line hidden return; case 4: this.mainMenu = ((System.Windows.Controls.Menu)(target)); return; case 5: this.menuItemFile = ((System.Windows.Controls.MenuItem)(target)); #line 17 "..\..\MainWindow.xaml" this.menuItemFile.MouseEnter += new System.Windows.Input.MouseEventHandler(this.menuItemFile_MouseEnter); #line default #line hidden return; case 6: this.menuItemNew = ((System.Windows.Controls.MenuItem)(target)); return; case 7: this.menuItemOpen = ((System.Windows.Controls.MenuItem)(target)); return; case 8: this.menuItemAdd = ((System.Windows.Controls.MenuItem)(target)); return; case 9: this.menuItemClose = ((System.Windows.Controls.MenuItem)(target)); return; case 10: this.menuItemRecentProject = ((System.Windows.Controls.MenuItem)(target)); return; case 12: this.menuItemExit = ((System.Windows.Controls.MenuItem)(target)); return; case 13: this.menuItemEdit = ((System.Windows.Controls.MenuItem)(target)); return; case 14: this.menuItemUndo = ((System.Windows.Controls.MenuItem)(target)); return; case 15: this.menuItemCut = ((System.Windows.Controls.MenuItem)(target)); return; case 16: this.menuItemCopy = ((System.Windows.Controls.MenuItem)(target)); return; case 17: this.menuItemPaste = ((System.Windows.Controls.MenuItem)(target)); return; case 18: this.menuItemDelete = ((System.Windows.Controls.MenuItem)(target)); return; case 19: this.menuItemView = ((System.Windows.Controls.MenuItem)(target)); return; case 20: this.menuItemProjResManager = ((System.Windows.Controls.MenuItem)(target)); return; case 21: this.menuItemProjAttrPage = ((System.Windows.Controls.MenuItem)(target)); return; case 22: this.menuItemTools = ((System.Windows.Controls.MenuItem)(target)); return; case 23: this.menuItemAbout = ((System.Windows.Controls.MenuItem)(target)); #line 50 "..\..\MainWindow.xaml" this.menuItemAbout.Click += new System.Windows.RoutedEventHandler(this.menuItemHelp_Click); #line default #line hidden return; case 24: this.Panel = ((Xceed.Wpf.AvalonDock.Layout.LayoutPanel)(target)); return; case 25: this.RightAnchorableGroup = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorablePaneGroup)(target)); return; case 26: this.RightPane = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorablePane)(target)); return; case 27: this.NodeNameTextBox = ((System.Windows.Controls.TextBox)(target)); #line 77 "..\..\MainWindow.xaml" this.NodeNameTextBox.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.NodeNameTextBox_TextChanged); #line default #line hidden return; case 28: this.WaveLengthStartTB = ((System.Windows.Controls.TextBox)(target)); #line 80 "..\..\MainWindow.xaml" this.WaveLengthStartTB.AddHandler(System.Windows.DataObject.PastingEvent, new System.Windows.DataObjectPastingEventHandler(this.WaveLengthTB_Pasting)); #line default #line hidden #line 80 "..\..\MainWindow.xaml" this.WaveLengthStartTB.PreviewKeyDown += new System.Windows.Input.KeyEventHandler(this.WaveLengthTB_PreviewKeyDown); #line default #line hidden return; case 29: this.WaveLengthSpaceTB = ((System.Windows.Controls.TextBox)(target)); #line 82 "..\..\MainWindow.xaml" this.WaveLengthSpaceTB.AddHandler(System.Windows.DataObject.PastingEvent, new System.Windows.DataObjectPastingEventHandler(this.WaveLengthTB_Pasting)); #line default #line hidden #line 82 "..\..\MainWindow.xaml" this.WaveLengthSpaceTB.PreviewKeyDown += new System.Windows.Input.KeyEventHandler(this.WaveLengthTB_PreviewKeyDown); #line default #line hidden return; case 30: this.AppendButton = ((System.Windows.Controls.Button)(target)); #line 85 "..\..\MainWindow.xaml" this.AppendButton.Click += new System.Windows.RoutedEventHandler(this.AppendButton_Click); #line default #line hidden return; case 31: this.TipsTextBlock = ((System.Windows.Controls.TextBlock)(target)); return; case 32: this.IsSortTimeCheckBox = ((System.Windows.Controls.CheckBox)(target)); return; case 33: this.IsReverseCheckBox = ((System.Windows.Controls.CheckBox)(target)); return; case 34: this.DirTreeView = ((System.Windows.Controls.TreeView)(target)); return; case 35: this.LeftGroup = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorGroup)(target)); return; case 36: this.RightGroup = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorGroup)(target)); return; case 37: this.TopGroup = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorGroup)(target)); return; case 38: this.BottomGroup = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorGroup)(target)); return; } this._contentLoaded = true; }
public void ToggleAutoHide() { #region Anchorable is already auto hidden if (IsAutoHidden) { var parentGroup = Parent as LayoutAnchorGroup; var parentSide = parentGroup.Parent as LayoutAnchorSide; var previousContainer = (( ILayoutPreviousContainer )parentGroup).PreviousContainer as LayoutAnchorablePane; var root = parentGroup.Root as LayoutRoot; if (previousContainer == null) { AnchorSide side = (parentGroup.Parent as LayoutAnchorSide).Side; switch (side) { case AnchorSide.Right: if (parentGroup.Root.RootPanel.Orientation == Orientation.Horizontal) { previousContainer = new LayoutAnchorablePane(); previousContainer.DockMinWidth = this.AutoHideMinWidth; parentGroup.Root.RootPanel.Children.Add(previousContainer); } else { previousContainer = new LayoutAnchorablePane(); LayoutPanel panel = new LayoutPanel() { Orientation = Orientation.Horizontal }; LayoutPanel oldRootPanel = parentGroup.Root.RootPanel as LayoutPanel; root.RootPanel = panel; panel.Children.Add(oldRootPanel); panel.Children.Add(previousContainer); } break; case AnchorSide.Left: if (parentGroup.Root.RootPanel.Orientation == Orientation.Horizontal) { previousContainer = new LayoutAnchorablePane(); previousContainer.DockMinWidth = this.AutoHideMinWidth; parentGroup.Root.RootPanel.Children.Insert(0, previousContainer); } else { previousContainer = new LayoutAnchorablePane(); LayoutPanel panel = new LayoutPanel() { Orientation = Orientation.Horizontal }; LayoutPanel oldRootPanel = parentGroup.Root.RootPanel as LayoutPanel; root.RootPanel = panel; panel.Children.Add(previousContainer); panel.Children.Add(oldRootPanel); } break; case AnchorSide.Top: if (parentGroup.Root.RootPanel.Orientation == Orientation.Vertical) { previousContainer = new LayoutAnchorablePane(); previousContainer.DockMinHeight = this.AutoHideMinHeight; parentGroup.Root.RootPanel.Children.Insert(0, previousContainer); } else { previousContainer = new LayoutAnchorablePane(); LayoutPanel panel = new LayoutPanel() { Orientation = Orientation.Vertical }; LayoutPanel oldRootPanel = parentGroup.Root.RootPanel as LayoutPanel; root.RootPanel = panel; panel.Children.Add(previousContainer); panel.Children.Add(oldRootPanel); } break; case AnchorSide.Bottom: if (parentGroup.Root.RootPanel.Orientation == Orientation.Vertical) { previousContainer = new LayoutAnchorablePane(); previousContainer.DockMinHeight = this.AutoHideMinHeight; parentGroup.Root.RootPanel.Children.Add(previousContainer); } else { previousContainer = new LayoutAnchorablePane(); LayoutPanel panel = new LayoutPanel() { Orientation = Orientation.Vertical }; LayoutPanel oldRootPanel = parentGroup.Root.RootPanel as LayoutPanel; root.RootPanel = panel; panel.Children.Add(oldRootPanel); panel.Children.Add(previousContainer); } break; } } //I'm about to remove parentGroup, redirect any content (ie hidden contents) that point to it //to previousContainer foreach (var cnt in root.Descendents().OfType <ILayoutPreviousContainer>().Where(c => c.PreviousContainer == parentGroup)) { cnt.PreviousContainer = previousContainer; } foreach (var anchorableToToggle in parentGroup.Children.ToArray()) { previousContainer.Children.Add(anchorableToToggle); } if (previousContainer.Children.Count > 0) { // Select the LayoutContent where the Toggle pin button was pressed. previousContainer.SelectedContentIndex = previousContainer.Children.IndexOf(this); } parentSide.Children.Remove(parentGroup); var parent = previousContainer.Parent as LayoutGroupBase; while ((parent != null)) { if (parent is LayoutGroup <ILayoutPanelElement> ) { ((LayoutGroup <ILayoutPanelElement>)parent).ComputeVisibility(); } parent = parent.Parent as LayoutGroupBase; } } #endregion #region Anchorable is docked else if (Parent is LayoutAnchorablePane) { var root = Root; var parentPane = Parent as LayoutAnchorablePane; var newAnchorGroup = new LayoutAnchorGroup(); (( ILayoutPreviousContainer )newAnchorGroup).PreviousContainer = parentPane; foreach (var anchorableToImport in parentPane.Children.ToArray()) { newAnchorGroup.Children.Add(anchorableToImport); } //detect anchor side for the pane var anchorSide = parentPane.GetSide(); switch (anchorSide) { case AnchorSide.Right: if (root.RightSide != null) { root.RightSide.Children.Add(newAnchorGroup); } break; case AnchorSide.Left: if (root.LeftSide != null) { root.LeftSide.Children.Add(newAnchorGroup); } break; case AnchorSide.Top: if (root.TopSide != null) { root.TopSide.Children.Add(newAnchorGroup); } break; case AnchorSide.Bottom: if (root.BottomSide != null) { root.BottomSide.Children.Add(newAnchorGroup); } break; } } #endregion }
public void ToggleAutoHide() { #region Anchorable is already auto hidden if (IsAutoHidden) { var parentGroup = Parent as LayoutAnchorGroup; var parentSide = parentGroup.Parent as LayoutAnchorSide; var previousContainer = ((ILayoutPreviousContainer)parentGroup).PreviousContainer as LayoutAnchorablePane; if (previousContainer == null) { AnchorSide side = (parentGroup.Parent as LayoutAnchorSide).Side; switch (side) { case AnchorSide.Right: if (parentGroup.Root.RootPanel.Orientation == Orientation.Horizontal) { previousContainer = new LayoutAnchorablePane(); parentGroup.Root.RootPanel.Children.Add(previousContainer); } else { previousContainer = new LayoutAnchorablePane(); LayoutPanel panel = new LayoutPanel() { Orientation = Orientation.Horizontal }; LayoutRoot root = parentGroup.Root as LayoutRoot; LayoutPanel oldRootPanel = parentGroup.Root.RootPanel as LayoutPanel; root.RootPanel = panel; panel.Children.Add(oldRootPanel); panel.Children.Add(previousContainer); } break; case AnchorSide.Left: if (parentGroup.Root.RootPanel.Orientation == Orientation.Horizontal) { previousContainer = new LayoutAnchorablePane(); parentGroup.Root.RootPanel.Children.Insert(0, previousContainer); } else { previousContainer = new LayoutAnchorablePane(); LayoutPanel panel = new LayoutPanel() { Orientation = Orientation.Horizontal }; LayoutRoot root = parentGroup.Root as LayoutRoot; LayoutPanel oldRootPanel = parentGroup.Root.RootPanel as LayoutPanel; root.RootPanel = panel; panel.Children.Add(previousContainer); panel.Children.Add(oldRootPanel); } break; case AnchorSide.Top: if (parentGroup.Root.RootPanel.Orientation == Orientation.Vertical) { previousContainer = new LayoutAnchorablePane(); parentGroup.Root.RootPanel.Children.Insert(0, previousContainer); } else { previousContainer = new LayoutAnchorablePane(); LayoutPanel panel = new LayoutPanel() { Orientation = Orientation.Vertical }; LayoutRoot root = parentGroup.Root as LayoutRoot; LayoutPanel oldRootPanel = parentGroup.Root.RootPanel as LayoutPanel; root.RootPanel = panel; panel.Children.Add(previousContainer); panel.Children.Add(oldRootPanel); } break; case AnchorSide.Bottom: if (parentGroup.Root.RootPanel.Orientation == Orientation.Vertical) { previousContainer = new LayoutAnchorablePane(); parentGroup.Root.RootPanel.Children.Add(previousContainer); } else { previousContainer = new LayoutAnchorablePane(); LayoutPanel panel = new LayoutPanel() { Orientation = Orientation.Vertical }; LayoutRoot root = parentGroup.Root as LayoutRoot; LayoutPanel oldRootPanel = parentGroup.Root.RootPanel as LayoutPanel; root.RootPanel = panel; panel.Children.Add(oldRootPanel); panel.Children.Add(previousContainer); } break; } // Do something about initializing the docks of previousContainer GridLength[] defaultdock = LayoutSetting.GetDefaultDockAnchorable(Title); previousContainer.DockWidth = defaultdock[0]; previousContainer.DockHeight = defaultdock[1]; } else { //I'm about to remove parentGroup, redirect any content (ie hidden contents) that point to it //to previousContainer LayoutRoot root = parentGroup.Root as LayoutRoot; foreach (var cnt in root.Descendents().OfType <ILayoutPreviousContainer>().Where(c => c.PreviousContainer == parentGroup)) { cnt.PreviousContainer = previousContainer; } } foreach (var anchorableToToggle in parentGroup.Children.ToArray()) { previousContainer.Children.Add(anchorableToToggle); } parentSide.Children.Remove(parentGroup); IsDock = true; } #endregion #region Anchorable is docked else if (Parent is LayoutAnchorablePane) { IsActive = false; IsDock = false; IsFloat = false; var root = Root; var parentPane = Parent as LayoutAnchorablePane; var newAnchorGroup = new LayoutAnchorGroup(); ((ILayoutPreviousContainer)newAnchorGroup).PreviousContainer = parentPane; foreach (var anchorableToImport in parentPane.Children.ToArray()) { newAnchorGroup.Children.Add(anchorableToImport); } //detect anchor side for the pane var anchorSide = parentPane.GetSide(); switch (anchorSide) { case AnchorSide.Right: root.RightSide.Children.Add(newAnchorGroup); LayoutSetting.AddDefaultSideAnchorable(Title, "RIGHT"); break; case AnchorSide.Left: root.LeftSide.Children.Add(newAnchorGroup); LayoutSetting.AddDefaultSideAnchorable(Title, "LEFT"); break; case AnchorSide.Top: root.TopSide.Children.Add(newAnchorGroup); LayoutSetting.AddDefaultSideAnchorable(Title, "TOP"); break; case AnchorSide.Bottom: root.BottomSide.Children.Add(newAnchorGroup); LayoutSetting.AddDefaultSideAnchorable(Title, "BOTTOM"); break; } } #endregion }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.munMenu = ((System.Windows.Controls.Menu)(target)); return; case 2: this.fileSave = ((System.Windows.Controls.MenuItem)(target)); #line 18 "..\..\MainWindow.xaml" this.fileSave.Click += new System.Windows.RoutedEventHandler(this.fileSave_Click); #line default #line hidden return; case 3: this.fileLoad = ((System.Windows.Controls.MenuItem)(target)); #line 19 "..\..\MainWindow.xaml" this.fileLoad.Click += new System.Windows.RoutedEventHandler(this.fileLoad_Click); #line default #line hidden return; case 4: this.programExit = ((System.Windows.Controls.MenuItem)(target)); #line 21 "..\..\MainWindow.xaml" this.programExit.Click += new System.Windows.RoutedEventHandler(this.programExit_Click); #line default #line hidden return; case 5: this.miLeft = ((System.Windows.Controls.MenuItem)(target)); #line 25 "..\..\MainWindow.xaml" this.miLeft.Click += new System.Windows.RoutedEventHandler(this.imageLoad_Click); #line default #line hidden return; case 6: this.miRight = ((System.Windows.Controls.MenuItem)(target)); return; case 7: this.miTop = ((System.Windows.Controls.MenuItem)(target)); return; case 8: this.miBottom = ((System.Windows.Controls.MenuItem)(target)); return; case 9: this.miAnchorPane = ((System.Windows.Controls.MenuItem)(target)); return; case 10: this.miAnchorVerticalPane = ((System.Windows.Controls.MenuItem)(target)); return; case 11: this.miDocumentPane = ((System.Windows.Controls.MenuItem)(target)); return; case 12: this.priorityPane = ((System.Windows.Controls.MenuItem)(target)); return; case 13: this.miAddAnchroable = ((System.Windows.Controls.MenuItem)(target)); return; case 14: this.miAddDocument = ((System.Windows.Controls.MenuItem)(target)); return; case 15: this.miOutPutWnd = ((System.Windows.Controls.MenuItem)(target)); return; case 16: this.miAutoHide = ((System.Windows.Controls.MenuItem)(target)); return; case 17: this.miGeneric = ((System.Windows.Controls.MenuItem)(target)); #line 46 "..\..\MainWindow.xaml" this.miGeneric.Click += new System.Windows.RoutedEventHandler(this.themeGeneric_Click); #line default #line hidden return; case 18: this.miAero = ((System.Windows.Controls.MenuItem)(target)); #line 47 "..\..\MainWindow.xaml" this.miAero.Click += new System.Windows.RoutedEventHandler(this.themeAero_Click); #line default #line hidden return; case 19: this.miDark = ((System.Windows.Controls.MenuItem)(target)); #line 48 "..\..\MainWindow.xaml" this.miDark.Click += new System.Windows.RoutedEventHandler(this.themeDark_Click); #line default #line hidden return; case 20: this.miLight = ((System.Windows.Controls.MenuItem)(target)); #line 49 "..\..\MainWindow.xaml" this.miLight.Click += new System.Windows.RoutedEventHandler(this.themeLight_Click); #line default #line hidden return; case 21: this.miMetro = ((System.Windows.Controls.MenuItem)(target)); #line 50 "..\..\MainWindow.xaml" this.miMetro.Click += new System.Windows.RoutedEventHandler(this.themeMetro_Click); #line default #line hidden return; case 22: this.miVS = ((System.Windows.Controls.MenuItem)(target)); #line 51 "..\..\MainWindow.xaml" this.miVS.Click += new System.Windows.RoutedEventHandler(this.themeVS_Click); #line default #line hidden return; case 23: this.DockManager = ((Xceed.Wpf.AvalonDock.DockingManager)(target)); return; case 24: this.Root = ((Xceed.Wpf.AvalonDock.Layout.LayoutRoot)(target)); return; case 25: this.Panel = ((Xceed.Wpf.AvalonDock.Layout.LayoutPanel)(target)); return; case 26: this.LeftAnchorableGroup = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorablePaneGroup)(target)); return; case 27: this.LeftPane = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorablePane)(target)); return; case 28: this.Solution = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorable)(target)); return; case 29: this.mToolBox = ((System.Windows.Controls.ListBox)(target)); return; case 30: this.TemperaPanel = ((System.Windows.Controls.ListBoxItem)(target)); return; case 31: this.MonitorControl = ((System.Windows.Controls.ListBoxItem)(target)); return; case 32: this.MotionSensor = ((System.Windows.Controls.ListBoxItem)(target)); return; case 33: this.WindowMagnet = ((System.Windows.Controls.ListBoxItem)(target)); return; case 34: this.DocumentGroup = ((Xceed.Wpf.AvalonDock.Layout.LayoutDocumentPaneGroup)(target)); return; case 35: this.DocumentPane = ((Xceed.Wpf.AvalonDock.Layout.LayoutDocumentPane)(target)); return; case 36: this.mEidtor = ((System.Windows.Controls.Canvas)(target)); #line 83 "..\..\MainWindow.xaml" this.mEidtor.DragOver += new System.Windows.DragEventHandler(this.OnDragOver); #line default #line hidden #line 83 "..\..\MainWindow.xaml" this.mEidtor.Drop += new System.Windows.DragEventHandler(this.OnDrop); #line default #line hidden return; case 37: this.backgroundImage = ((System.Windows.Media.ImageBrush)(target)); return; case 38: this.RightAnchorableGroup = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorablePaneGroup)(target)); return; case 39: this.RightPane = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorablePane)(target)); return; case 40: this.mEditSize = ((System.Windows.Controls.ListBoxItem)(target)); return; case 41: this.mPosition = ((System.Windows.Controls.ListBoxItem)(target)); return; case 42: this.LeftGroup = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorGroup)(target)); return; case 43: this.RightGroup = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorGroup)(target)); return; case 44: this.TopGroup = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorGroup)(target)); return; case 45: this.BottomGroup = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorGroup)(target)); return; } this._contentLoaded = true; }
public void CollectGarbage() { int num; Func <LayoutContent, bool> func = null; bool flag = true; do { flag = true; foreach (ILayoutPreviousContainer layoutPreviousContainer in this.Descendents().OfType <ILayoutPreviousContainer>().Where <ILayoutPreviousContainer>((ILayoutPreviousContainer c) => { if (c.PreviousContainer == null) { return(false); } if (c.PreviousContainer.Parent == null) { return(true); } return(c.PreviousContainer.Parent.Root != this); })) { layoutPreviousContainer.PreviousContainer = null; } foreach (ILayoutPane layoutPane in from p in this.Descendents().OfType <ILayoutPane>() where p.ChildrenCount == 0 select p) { IEnumerable <LayoutContent> layoutContents = this.Descendents().OfType <LayoutContent>(); Func <LayoutContent, bool> func1 = func; if (func1 == null) { Func <LayoutContent, bool> previousContainer = (LayoutContent c) => { if (((ILayoutPreviousContainer)c).PreviousContainer != layoutPane) { return(false); } return(!c.IsFloating); }; Func <LayoutContent, bool> func2 = previousContainer; func = previousContainer; func1 = func2; } foreach (LayoutContent layoutContent in layoutContents.Where <LayoutContent>(func1)) { if (layoutContent is LayoutAnchorable && !((LayoutAnchorable)layoutContent).IsVisible) { continue; } ((ILayoutPreviousContainer)layoutContent).PreviousContainer = null; layoutContent.PreviousContainerIndex = -1; } if (layoutPane is LayoutDocumentPane && this.Descendents().OfType <LayoutDocumentPane>().Count <LayoutDocumentPane>((LayoutDocumentPane c) => c != layoutPane) == 0 || this.Descendents().OfType <ILayoutPreviousContainer>().Any <ILayoutPreviousContainer>((ILayoutPreviousContainer c) => c.PreviousContainer == layoutPane)) { continue; } layoutPane.Parent.RemoveChild(layoutPane); flag = false; goto Label0; } Label0: if (!flag) { using (IEnumerator <LayoutAnchorablePaneGroup> enumerator = ( from p in this.Descendents().OfType <LayoutAnchorablePaneGroup>() where p.ChildrenCount == 0 select p).GetEnumerator()) { if (enumerator.MoveNext()) { LayoutAnchorablePaneGroup current = enumerator.Current; current.Parent.RemoveChild(current); flag = false; } } } if (!flag) { using (IEnumerator <LayoutPanel> enumerator1 = ( from p in this.Descendents().OfType <LayoutPanel>() where p.ChildrenCount == 0 select p).GetEnumerator()) { if (enumerator1.MoveNext()) { LayoutPanel layoutPanel = enumerator1.Current; layoutPanel.Parent.RemoveChild(layoutPanel); flag = false; } } } if (!flag) { using (IEnumerator <LayoutFloatingWindow> enumerator2 = ( from p in this.Descendents().OfType <LayoutFloatingWindow>() where p.ChildrenCount == 0 select p).GetEnumerator()) { if (enumerator2.MoveNext()) { LayoutFloatingWindow layoutFloatingWindow = enumerator2.Current; layoutFloatingWindow.Parent.RemoveChild(layoutFloatingWindow); flag = false; } } } if (flag) { continue; } using (IEnumerator <LayoutAnchorGroup> enumerator3 = ( from p in this.Descendents().OfType <LayoutAnchorGroup>() where p.ChildrenCount == 0 select p).GetEnumerator()) { if (enumerator3.MoveNext()) { LayoutAnchorGroup layoutAnchorGroup = enumerator3.Current; layoutAnchorGroup.Parent.RemoveChild(layoutAnchorGroup); flag = false; } } }while (!flag); do { flag = true; LayoutAnchorablePaneGroup[] array = this.Descendents().OfType <LayoutAnchorablePaneGroup>().Where <LayoutAnchorablePaneGroup>((LayoutAnchorablePaneGroup p) => { if (p.ChildrenCount != 1) { return(false); } return(p.Children[0] is LayoutAnchorablePaneGroup); }).ToArray <LayoutAnchorablePaneGroup>(); num = 0; if (num >= (int)array.Length) { continue; } LayoutAnchorablePaneGroup orientation = array[num]; LayoutAnchorablePaneGroup item = orientation.Children[0] as LayoutAnchorablePaneGroup; orientation.Orientation = item.Orientation; orientation.RemoveChild(item); while (item.ChildrenCount > 0) { orientation.InsertChildAt(orientation.ChildrenCount, item.Children[0]); } flag = false; }while (!flag); do { flag = true; LayoutDocumentPaneGroup[] layoutDocumentPaneGroupArray = this.Descendents().OfType <LayoutDocumentPaneGroup>().Where <LayoutDocumentPaneGroup>((LayoutDocumentPaneGroup p) => { if (p.ChildrenCount != 1) { return(false); } return(p.Children[0] is LayoutDocumentPaneGroup); }).ToArray <LayoutDocumentPaneGroup>(); num = 0; if (num >= (int)layoutDocumentPaneGroupArray.Length) { continue; } LayoutDocumentPaneGroup layoutDocumentPaneGroup = layoutDocumentPaneGroupArray[num]; LayoutDocumentPaneGroup item1 = layoutDocumentPaneGroup.Children[0] as LayoutDocumentPaneGroup; layoutDocumentPaneGroup.Orientation = item1.Orientation; layoutDocumentPaneGroup.RemoveChild(item1); while (item1.ChildrenCount > 0) { layoutDocumentPaneGroup.InsertChildAt(layoutDocumentPaneGroup.ChildrenCount, item1.Children[0]); } flag = false; }while (!flag); this.UpdateActiveContentProperty(); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: #line 7 "..\..\MainWindow.xaml" ((SpectrumScanner.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded); #line default #line hidden return; case 2: this.mainDockingManager = ((Xceed.Wpf.AvalonDock.DockingManager)(target)); return; case 3: this.layoutRoot = ((Xceed.Wpf.AvalonDock.Layout.LayoutRoot)(target)); return; case 4: this.layoutPanel = ((Xceed.Wpf.AvalonDock.Layout.LayoutPanel)(target)); return; case 5: this.layoutAnchorableGroup = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorablePaneGroup)(target)); return; case 6: this.leftPane = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorablePane)(target)); return; case 7: this.taskList = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorable)(target)); return; case 8: #line 67 "..\..\MainWindow.xaml" ((System.Windows.Controls.ListBoxItem)(target)).Selected += new System.Windows.RoutedEventHandler(this.ListBoxItem_Selected_1); #line default #line hidden return; case 9: #line 68 "..\..\MainWindow.xaml" ((System.Windows.Controls.ListBoxItem)(target)).Selected += new System.Windows.RoutedEventHandler(this.ListBoxItem_Selected_2); #line default #line hidden return; case 10: #line 69 "..\..\MainWindow.xaml" ((System.Windows.Controls.ListBoxItem)(target)).Selected += new System.Windows.RoutedEventHandler(this.ListBoxItem_Selected_3); #line default #line hidden return; case 11: #line 70 "..\..\MainWindow.xaml" ((System.Windows.Controls.ListBoxItem)(target)).Selected += new System.Windows.RoutedEventHandler(this.ListBoxItem_Selected_4); #line default #line hidden return; case 12: this.DocumentGroup = ((Xceed.Wpf.AvalonDock.Layout.LayoutDocumentPaneGroup)(target)); return; case 13: this.DocumentPane = ((Xceed.Wpf.AvalonDock.Layout.LayoutDocumentPane)(target)); return; case 14: this.layoutDocument = ((Xceed.Wpf.AvalonDock.Layout.LayoutDocument)(target)); return; case 15: this.myGrid = ((System.Windows.Controls.Grid)(target)); return; case 16: this.border1 = ((System.Windows.Controls.Border)(target)); return; case 17: this.border2 = ((System.Windows.Controls.Border)(target)); return; case 18: this.border3 = ((System.Windows.Controls.Border)(target)); return; case 19: this.border4 = ((System.Windows.Controls.Border)(target)); return; case 20: this.RightAnchorableGroup = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorablePaneGroup)(target)); return; case 21: this.RightPane = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorablePane)(target)); return; case 22: this.leftGroup = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorGroup)(target)); return; case 23: this.rightGroup = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorGroup)(target)); return; case 24: this.topGroup = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorGroup)(target)); return; case 25: this.bottomGroup = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorGroup)(target)); return; } this._contentLoaded = true; }
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); }