Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
        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;
        }