Ejemplo n.º 1
1
 public void AfterInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableShown)
 {
     var content = anchorableShown.Content as PaneViewModel;
     if(content != null && content.DoFloating)
     {
         anchorableShown.Float();
     }
 }
Ejemplo n.º 2
0
        public bool BeforeInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableToShow, ILayoutContainer destinationContainer)
        {           
            //Determine panel name for given view model type
            string destPaneName = string.Empty;
            if (anchorableToShow.Content is JadeControls.Workspace.ViewModel.WorkspaceViewModel ||
                anchorableToShow.Content is JadeControls.SymbolInspector.SymbolInspectorPaneViewModel ||
                anchorableToShow.Content is JadeControls.CursorInspector.CursorInspectorPaneViewModel)
            {
                destPaneName = "LeftToolPanel";
            }
            else if (anchorableToShow.Content is JadeControls.OutputControl.ViewModel.OutputViewModel ||
                    anchorableToShow.Content is JadeControls.SearchResultsControl.ViewModel.SearchResultsPaneViewModel)
            {
                destPaneName = "LowerToolPanel";
            }
            else if (anchorableToShow.Content is JadeControls.ContextTool.ContextPaneViewModel)
            {
                destPaneName = "RightToolPanel";
            }
            else
            {
                return false;
            }

            //Find pane
            var toolsPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == destPaneName);
            if (toolsPane != null)
            {
                //Add
                toolsPane.Children.Add(anchorableToShow);
                return true;
            } 
            return false;
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this._demo = ((Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views.ThemingAvalonDockView)(target));
                return;

            case 2:

            #line 33 "..\..\..\..\..\..\Samples\Theming\Views\ThemingAvalonDockView.xaml"
                ((System.Windows.Documents.Hyperlink)(target)).RequestNavigate += new System.Windows.Navigation.RequestNavigateEventHandler(this.Hyperlink_RequestNavigate);

            #line default
            #line hidden
                return;

            case 3:
                this._themeCombo = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 4:
                this.metroDarkComboBoxItem = ((Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views.AvalonDockComboBoxItem)(target));
                return;

            case 5:
                this.metroLightComboBoxItem = ((Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views.AvalonDockComboBoxItem)(target));
                return;

            case 6:
                this.SampleBorder = ((System.Windows.Controls.Border)(target));
                return;

            case 7:
                this._dockingManager = ((Xceed.Wpf.AvalonDock.DockingManager)(target));
                return;

            case 8:
                this._layoutRoot = ((Xceed.Wpf.AvalonDock.Layout.LayoutRoot)(target));
                return;

            case 9:
                this._openSourceScreenShot = ((System.Windows.Controls.Image)(target));
                return;

            case 10:
                this._openSourceTextHyperlink = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 11:

            #line 313 "..\..\..\..\..\..\Samples\Theming\Views\ThemingAvalonDockView.xaml"
                ((System.Windows.Documents.Hyperlink)(target)).RequestNavigate += new System.Windows.Navigation.RequestNavigateEventHandler(this.Hyperlink_RequestNavigate);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
        private static LayoutAnchorablePane CreateAnchorablePane(LayoutRoot layout, Orientation orientation,
            string paneName, InsertPosition position)
        {
            var layoutPanels = layout.Descendents().OfType<LayoutPanel>().ToArray();
            var parent = layoutPanels.FirstOrDefault(d => d != null && d.Orientation == orientation);
            if (parent == null)
            {
                parent = layoutPanels.FirstOrDefault();
                position = InsertPosition.Start;
            }
            var toolsPane = new LayoutAnchorablePane { Name = paneName };
            if (parent != null)
            {
                if (position == InsertPosition.Start)
                    parent.InsertChildAt(0, toolsPane);
                else
                    parent.Children.Add(toolsPane);
            }
            else
            {
                var layoutAnchorableFloatingWindow = new LayoutAnchorableFloatingWindow();
                toolsPane.Parent = layoutAnchorableFloatingWindow;

            }
            return toolsPane;
        }
Ejemplo n.º 5
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this._dockingManager = ((Xceed.Wpf.AvalonDock.DockingManager)(target));
                return;

            case 2:
                this._layoutRoot = ((Xceed.Wpf.AvalonDock.Layout.LayoutRoot)(target));
                return;

            case 3:

            #line 160 "..\..\..\..\..\..\Samples\AvalonDock\Views\AvalonDockView.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.SaveButton_Click);

            #line default
            #line hidden
                return;

            case 4:

            #line 164 "..\..\..\..\..\..\Samples\AvalonDock\Views\AvalonDockView.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.LoadButton_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Ejemplo n.º 6
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 8 "..\..\MainView.xaml"
                ((AvalonDockExam.MainView)(target)).SizeChanged += new System.Windows.SizeChangedEventHandler(this.Window_SizeChanged);

            #line default
            #line hidden
                return;

            case 2:
                this._maingrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 3:
                this._dockingManager = ((Xceed.Wpf.AvalonDock.DockingManager)(target));
                return;

            case 4:
                this._layoutRoot = ((Xceed.Wpf.AvalonDock.Layout.LayoutRoot)(target));
                return;
            }
            this._contentLoaded = true;
        }
Ejemplo n.º 7
0
        public bool BeforeInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableToShow, ILayoutContainer destinationContainer)
        {
            var tool = anchorableToShow.Content as ITool;
            if (tool != null)
            {
                var preferredLocation = tool.PreferredLocation;
                string paneName = GetPaneName(preferredLocation);
                var toolsPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == paneName);
                if (toolsPane == null)
                {
                    switch (preferredLocation)
                    {
                        case PaneLocation.Left:
                            toolsPane = CreateAnchorablePane(layout, Orientation.Horizontal, paneName, InsertPosition.Start);
                            break;
                        case PaneLocation.Right:
                            toolsPane = CreateAnchorablePane(layout, Orientation.Horizontal, paneName, InsertPosition.End);
                            break;
                        case PaneLocation.Bottom:
                            toolsPane = CreateAnchorablePane(layout, Orientation.Vertical, paneName, InsertPosition.End);
                            break;
                        default:
                            throw new ArgumentOutOfRangeException();
                    }
                }
                toolsPane.Children.Add(anchorableToShow);
                return true;
            }

            return false;
        }
Ejemplo n.º 8
0
        public bool BeforeInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableToShow, ILayoutContainer destinationContainer)
        {
            if (destinationContainer != null &&
                destinationContainer.FindParent<LayoutFloatingWindow>() != null)
            {
                return false;
            }

            foreach (var viewModelPane in ViewModelPanes)
            {
                if (viewModelPane.Item1.IsInstanceOfType(anchorableToShow.Content))
                {
                    var pane = layout
                        .Descendents()
                        .OfType<LayoutAnchorablePane>()
                        .SingleOrDefault(p => p.Name == viewModelPane.Item2);

                    if (pane != null)
                    {
                        pane.Children.Add(anchorableToShow);

                        if (viewModelPane.Item3)
                        {
                            anchorableToShow.ToggleAutoHide();
                        }

                        return true;
                    }
                }
            }

            return false;
        }
Ejemplo n.º 9
0
        public DockingManager()
        {
            Layout = new LayoutRoot() { RootPanel = new LayoutPanel(new LayoutDocumentPaneGroup(new LayoutDocumentPane())) };


            this.Loaded += new RoutedEventHandler(DockingManager_Loaded);
            this.Unloaded += new RoutedEventHandler(DockingManager_Unloaded);
        }
Ejemplo n.º 10
0
        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;
        }
Ejemplo n.º 11
0
		public DockingManager()
		{
			Layout = new LayoutRoot() { RootPanel = new LayoutPanel(new LayoutDocumentPaneGroup(new LayoutDocumentPane())) };

			EventManager.RegisterClassHandler(typeof(Window), Keyboard.PreviewKeyDownEvent, new KeyEventHandler(GlobalPreviewKeyDownEvent), true);

			this.Loaded += new RoutedEventHandler(DockingManager_Loaded);
			this.Unloaded += new RoutedEventHandler(DockingManager_Unloaded);
		}
Ejemplo n.º 12
0
		public void AfterInsertDocument(LayoutRoot layout, LayoutDocument anchorableShown)
		{
			var parent = anchorableShown.Parent as LayoutDocumentPane;
			if (parent == null)
				parent = anchorableShown.FindParent<LayoutDocumentPane>();
			if (parent != null)
			{
			}
		}
Ejemplo n.º 13
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
 {
     switch (connectionId)
     {
     case 1:
         this._layoutRoot = ((Xceed.Wpf.AvalonDock.Layout.LayoutRoot)(target));
         return;
     }
     this._contentLoaded = true;
 }
        public DockingManager()
        {
#if !VS2008
          Layout = new LayoutRoot() { RootPanel = new LayoutPanel(new LayoutDocumentPaneGroup(new LayoutDocumentPane())) };
#else
          this.SetCurrentValue( DockingManager.LayoutProperty, new LayoutRoot() { RootPanel = new LayoutPanel(new LayoutDocumentPaneGroup(new LayoutDocumentPane())) } );
#endif
          this.Loaded += new RoutedEventHandler(DockingManager_Loaded);
          this.Unloaded += new RoutedEventHandler(DockingManager_Unloaded);
        }
Ejemplo n.º 15
0
        //http://avalondock.codeplex.com/wikipage?title=AvalonDock%202.0%20Getting%20Start%20Guide&referringTitle=Documentation
		public bool BeforeInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableToShow, ILayoutContainer destinationContainer)
		{
            if (anchorableToShow.Content is ITool)
            {
                var preferredLocation = ((ITool) anchorableToShow.Content).PreferredLocation;
                string paneName = GetPaneName(preferredLocation);
                var toolsPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == paneName);
                if (toolsPane == null)
                {
                    switch (preferredLocation)
                    {
                        case PaneLocation.Left:
                        {
                            //TODO: this should use two steps: first, try to add to existing "LayoutAnchorablePane" if not create layoutAnchorGroup like below
                            var layoutAnchorSide = layout.Descendents().OfType<LayoutAnchorSide>().First(side => side.Side == AnchorSide.Left);
                            var layoutAnchorGroup = new LayoutAnchorGroup();
                            layoutAnchorGroup.InsertChildAt(0, anchorableToShow);
                            layoutAnchorSide.InsertChildAt(0, layoutAnchorGroup);
                            anchorableToShow.AutoHideWidth = 200;

                            //var parent = layout.Descendents().OfType<LayoutPanel>().First(d => d.Orientation == Orientation.Horizontal);
                            //toolsPane = new LayoutAnchorablePane { DockWidth = new GridLength(200, GridUnitType.Pixel) };
                        }
                            break;
                        case PaneLocation.Right:
                        {
                            var parent = layout.Descendents().OfType<LayoutPanel>().First(d => d.Orientation == Orientation.Horizontal);
                            toolsPane = new LayoutAnchorablePane { DockWidth = new GridLength(200, GridUnitType.Pixel) };
                            parent.Children.Add(toolsPane);
                        }
                            break;
                        case PaneLocation.Bottom:
                        {
                            var ds = layout.Descendents().ToList();
                            var items = layout.Descendents().OfType<LayoutPanel>().ToList();
                            var items2 = layout.Descendents().OfType<LayoutAnchorGroup>().ToList();
                            //var parent = items2.First();
                            var parent = layout.Descendents().OfType<LayoutPanel>().First(d => d.Orientation == Orientation.Vertical);
                            toolsPane = new LayoutAnchorablePane { DockHeight = new GridLength(300, GridUnitType.Pixel) };
                            parent.Children.Add(toolsPane);
                        }
                            break;
                        default:
                            throw new ArgumentOutOfRangeException();
                    }
                }
                if(toolsPane != null)
                    toolsPane.Children.Add(anchorableToShow);
                return true;
            }

			return false;
		}
Ejemplo n.º 16
0
        public bool BeforeInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableToShow, ILayoutContainer destinationContainer)
        {
            if (destinationContainer != null &&
                destinationContainer.FindParent<LayoutFloatingWindow>() != null)
                return false;

            var toolsPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == "ToolsPane");
            if (toolsPane != null)
            {
                toolsPane.Children.Add(anchorableToShow);
                return true;
            }

            return false;
        }
Ejemplo n.º 17
0
        public bool BeforeInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableToShow, ILayoutContainer destinationContainer)
        {
            var myViewModel = anchorableToShow.Content as IToolWindow;
            if (myViewModel != null)
            {
                var lap = layout.Descendents();
                var pane = lap.OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == myViewModel.DefaultDockingPane);
                if (pane != null)
                {
                    pane.Children.Add(anchorableToShow);
                    return true;
                }
            }

            return false;
        }
Ejemplo n.º 18
0
        public bool BeforeInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorable, ILayoutContainer destination)
        {
            LayoutAnchorablePane pane = destination as LayoutAnchorablePane;
            if (destination != null && destination.FindParent<LayoutFloatingWindow>() != null)
            {
                return false;
            }

            LayoutAnchorablePane files = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == "pnFiles");
            if (files != null)
            {
                files.Children.Add(anchorable);
                return true;
            }
            return false;
        }
Ejemplo n.º 19
0
        public bool BeforeInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableToShow, ILayoutContainer destinationContainer)
        {
            //AD wants to add the anchorable into destinationContainer
            //just for test provide a new anchorablepane
            //if the pane is floating let the manager go ahead
            LayoutAnchorablePane destPane = destinationContainer as LayoutAnchorablePane;
            if (destinationContainer != null &&
                destinationContainer.FindParent<LayoutFloatingWindow>() != null)
                return false;

            if (anchorableToShow.Content is SectionBrowserViewModel)
            {
                var toolsPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == "SectionBrowserPane");
                if (toolsPane != null)
                {
                   // anchorableToShow.CanHide = false;
                    toolsPane.Children.Add(anchorableToShow);
                    return true;
                }
            }

            if (anchorableToShow.Content is BlockGroupBrowserViewModel)
            {
                var toolsPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == "BlockGroupBrowserPane");
                if (toolsPane != null)
                {
                   // anchorableToShow.CanHide = false;
                    toolsPane.Children.Add(anchorableToShow);
                    return true;
                }
            }

            if (anchorableToShow.Content is BlockOutputPreviewViewModel)
            {
                var toolsPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == "BlockOutputPreviewPane");
                if (toolsPane != null)
                {
                    toolsPane.Children.Add(anchorableToShow);
                    return true;
                }
            }

            return false;
        }
Ejemplo n.º 20
0
        public bool BeforeInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableToShow, ILayoutContainer destinationContainer)
        {
            //AD wants to add the anchorable into destinationContainer
            //just for test provide a new anchorablepane
            //if the pane is floating let the manager go ahead
            //LayoutAnchorablePane destPane = destinationContainer as LayoutAnchorablePane;
            //if (destinationContainer != null &&
            //    destinationContainer.FindParent<LayoutFloatingWindow>() != null)
            //    return false;

            //var toolsPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == "ToolsPane");
            //if (toolsPane != null)
            //{
            //    toolsPane.Children.Add(anchorableToShow);
            //    return true;
            //}

            return false;
        }
Ejemplo n.º 21
0
 public void AfterInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableShown)
 {
     //   var toolViewModel = anchorableShown.Content as ToolViewModel;
     //   if (toolViewModel != null)
     //   {
     //       switch (toolViewModel.DefaultPane)
     //       {
     //           case DefaultToolPane.Left:
     //           case DefaultToolPane.Right:
     //               anchorableShown.AutoHideMinWidth = (double)toolViewModel.Width;
     //               anchorableShown.AutoHideWidth = (double)toolViewModel.Width;
     //               break;
     //           case DefaultToolPane.Bottom:
     //               anchorableShown.AutoHideMinHeight = (double)toolViewModel.Height;
     //               anchorableShown.AutoHideHeight = 100.0;
     //               break;
     //       }
     //   }
 }
Ejemplo n.º 22
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.Window = ((RakunWin32.RakunStudio)(target));
                return;

            case 2:
                this.dockManager = ((System.Windows.Controls.DockPanel)(target));
                return;

            case 3:
                this.MIPort = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 5:
                this.MIBoundrate = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 7:
                this.MIDatabit = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 9:
                this.statusBar = ((System.Windows.Controls.Primitives.StatusBar)(target));
                return;

            case 10:
                this.RootLayout = ((Xceed.Wpf.AvalonDock.DockingManager)(target));
                return;

            case 11:
                this._layoutRoot = ((Xceed.Wpf.AvalonDock.Layout.LayoutRoot)(target));
                return;

            case 12:
                this.Monitor = ((System.Windows.Controls.ListBox)(target));
                return;
            }
            this._contentLoaded = true;
        }
Ejemplo n.º 23
0
 private bool BeforeInsertContent(LayoutRoot layout, LayoutContent anchorableToShow)
 {
     var viewModel = (ViewModelBase) anchorableToShow.Content;
     var layoutContent =
         layout.Descendents().OfType<LayoutContent>().FirstOrDefault(x => x.ContentId == viewModel.ContextId);
     if (layoutContent == null)
         return false;
     layoutContent.Content = anchorableToShow.Content;
     // Add layoutContent to it's previous container
     var layoutContainer =
         layoutContent.GetType()
             .GetProperty("PreviousContainer", BindingFlags.NonPublic | BindingFlags.Instance)
             .GetValue(layoutContent, null) as ILayoutContainer;
     if (layoutContainer is LayoutAnchorablePane)
         (layoutContainer as LayoutAnchorablePane).Children.Add(layoutContent as LayoutAnchorable);
     else if (layoutContainer is LayoutDocumentPane)
         (layoutContainer as LayoutDocumentPane).Children.Add(layoutContent);
     else
         throw new NotSupportedException();
     return true;
 }
Ejemplo n.º 24
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this._layoutRoot = ((Xceed.Wpf.AvalonDock.Layout.LayoutRoot)(target));
                return;

            case 2:

            #line 37 "..\..\DockUserControl.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.AddDocument);

            #line default
            #line hidden
                return;

            case 3:

            #line 38 "..\..\DockUserControl.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.ClearCurrentCanvas);

            #line default
            #line hidden
                return;

            case 4:
                this.widthScrollControl = ((WPFToolkit.WidthScrollControl)(target));
                return;

            case 5:
                this.paletteControl = ((WPFToolkit.PaletteControl)(target));
                return;

            case 6:
                this.documentPane = ((Xceed.Wpf.AvalonDock.Layout.LayoutDocumentPane)(target));
                return;
            }
            this._contentLoaded = true;
        }
 public bool BeforeInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableToShow, ILayoutContainer destinationContainer)
 {
     bool result = false;
     if (layout != null
        && anchorableToShow != null)
     {
         var destPane = destinationContainer as LayoutAnchorablePane;
         if (anchorableToShow.Root == null)
         {
             anchorableToShow.AddToLayout(layout.Manager, GetContentAnchorableStrategy(anchorableToShow));
             bool isHidden = GetContentAnchorableIsHidden(anchorableToShow);
             if (isHidden)
             {
                 anchorableToShow.CanHide = true;
                 anchorableToShow.Hide();
             }
             result = true;
         }
         else if (destPane != null && anchorableToShow.IsHidden)
         {
             // Show a hidden Anchorable.
             if (anchorableToShow.PreviousContainerIndex < 0)
             {
                 destPane.Children.Add(anchorableToShow);
             }
             else
             {
                 int insertIndex = anchorableToShow.PreviousContainerIndex;
                 if (insertIndex > destPane.ChildrenCount)
                 {
                     insertIndex = destPane.ChildrenCount;
                 }
                 destPane.Children.Insert(insertIndex, anchorableToShow);
             }
             result = true;
         }
     }
     return result || m_WrappedStrategy.BeforeInsertAnchorable(layout, anchorableToShow, destinationContainer);
 }
Ejemplo n.º 26
0
 public void JustDecompileGenerated_set_Parent(ILayoutContainer value)
 {
     if (this._parent != value)
     {
         ILayoutContainer layoutContainer = this._parent;
         ILayoutRoot      layoutRoot      = this._root;
         this.RaisePropertyChanging("Parent");
         this.OnParentChanging(layoutContainer, value);
         this._parent = value;
         this.OnParentChanged(layoutContainer, value);
         this._root = this.Root;
         if (layoutRoot != this._root)
         {
             this.OnRootChanged(layoutRoot, this._root);
         }
         this.RaisePropertyChanged("Parent");
         LayoutRoot root = this.Root as LayoutRoot;
         if (root != null)
         {
             root.FireLayoutUpdated();
         }
     }
 }
Ejemplo n.º 27
0
 /// <summary>
 /// アンカー挿入後の処理です。
 /// </summary>
 /// <param name="layout">レイアウトです。</param>
 /// <param name="anchorableShown">アンカーの表示状態です。</param>
 public void AfterInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableShown)
 {
     var tool = anchorableShown.Content as IToolable;
     if (tool != null)
     {
         var anchorablePane = anchorableShown.Parent as LayoutAnchorablePane;
         if (anchorablePane != null && anchorablePane.ChildrenCount == 1)
         {
             switch (tool.Location)
             {
                 case PanelLocation.Left:
                 case PanelLocation.Right:
                     anchorablePane.DockWidth = new GridLength(tool.Width, GridUnitType.Pixel);
                     break;
                 case PanelLocation.Bottom:
                     anchorablePane.DockHeight = new GridLength(tool.Height, GridUnitType.Pixel);
                     break;
                 default:
                     anchorablePane.DockWidth = new GridLength(tool.Width, GridUnitType.Pixel);
                     break;
             }
         }
     }
 }
Ejemplo n.º 28
0
 public void AfterInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableShown)
 {
     // If this is the first anchorable added to this pane, then use the preferred size.
     var tool = anchorableShown.Content as ITool;
     if (tool != null)
     {
         var anchorablePane = anchorableShown.Parent as LayoutAnchorablePane;
         if (anchorablePane != null && anchorablePane.ChildrenCount == 1)
         {
             switch (tool.PreferredLocation)
             {
                 case PaneLocation.Left:
                 case PaneLocation.Right:
                     anchorablePane.DockWidth = new GridLength(tool.PreferredWidth, GridUnitType.Pixel);
                     break;
                 case PaneLocation.Bottom:
                     anchorablePane.DockHeight = new GridLength(tool.PreferredHeight, GridUnitType.Pixel);
                     break;
                 default:
                     throw new ArgumentOutOfRangeException();
             }
         }
     }
 }
Ejemplo n.º 29
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.RootVisual = ((System.Windows.Controls.Grid)(target));
                return;

            case 2:
                this.TopMenuGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 3:
                this.ProjectTitle = ((IS3.Desktop.UserControls.RaisedText)(target));
                return;

            case 4:

            #line 79 "..\..\MainFrame.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Home_Click);

            #line default
            #line hidden
                return;

            case 5:

            #line 87 "..\..\MainFrame.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Python_Click);

            #line default
            #line hidden
                return;

            case 6:
                this.DocMan = ((Xceed.Wpf.AvalonDock.DockingManager)(target));
                return;

            case 7:
                this._layoutRoot = ((Xceed.Wpf.AvalonDock.Layout.LayoutRoot)(target));
                return;

            case 8:
                this.ProjectPane = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorablePane)(target));
                return;

            case 9:
                this.ViewPane = ((Xceed.Wpf.AvalonDock.Layout.LayoutDocumentPane)(target));
                return;

            case 10:
                this.DataPane = ((Xceed.Wpf.AvalonDock.Layout.LayoutDocumentPane)(target));
                return;

            case 11:
                this.ipcHost = ((IS3.Python.IronPythonControl)(target));
                return;

            case 12:
                this.MyDataGrid = ((IS3.Desktop.IS3DataGrid)(target));
                return;

            case 13:
                this.DomainTreeHolder = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorablePane)(target));
                return;

            case 14:
                this.ToolsPane = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorablePane)(target));
                return;

            case 15:
                this.objViewHolder = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorable)(target));
                return;

            case 16:
                this.objectView = ((IS3.Desktop.ObjectView)(target));
                return;

            case 17:
                this.Tools = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorable)(target));
                return;

            case 18:
                this.ToolsPanel = ((IS3.Desktop.ToolsPanel)(target));
                return;
            }
            this._contentLoaded = true;
        }
Ejemplo n.º 30
0
 public LayoutEventArgs(Xceed.Wpf.AvalonDock.Layout.LayoutRoot layoutRoot)
 {
     this.LayoutRoot = layoutRoot;
 }
Ejemplo n.º 31
0
        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
        }
Ejemplo n.º 32
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 9 "..\..\MainWindow.xaml"
                ((WpfMap.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);

            #line default
            #line hidden

            #line 10 "..\..\MainWindow.xaml"
                ((WpfMap.MainWindow)(target)).PreviewKeyDown += new System.Windows.Input.KeyEventHandler(this.drawViewScroll_PreviewKeyDown);

            #line default
            #line hidden

            #line 11 "..\..\MainWindow.xaml"
                ((WpfMap.MainWindow)(target)).PreviewKeyUp += new System.Windows.Input.KeyEventHandler(this.drawViewScroll_PreviewKeyUp);

            #line default
            #line hidden
                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.Btn_Add_RFID = ((System.Windows.Controls.Button)(target));

            #line 61 "..\..\MainWindow.xaml"
                this.Btn_Add_RFID.Click += new System.Windows.RoutedEventHandler(this.Btn_Add_RFID_Click);

            #line default
            #line hidden
                return;

            case 5:
                this.Btn_Add_RouteLine = ((System.Windows.Controls.Button)(target));

            #line 62 "..\..\MainWindow.xaml"
                this.Btn_Add_RouteLine.Click += new System.Windows.RoutedEventHandler(this.Btn_Add_RouteLine_Click);

            #line default
            #line hidden
                return;

            case 6:
                this.Btn_Add_RouteForkLine = ((System.Windows.Controls.Button)(target));

            #line 63 "..\..\MainWindow.xaml"
                this.Btn_Add_RouteForkLine.Click += new System.Windows.RoutedEventHandler(this.Btn_Add_RouteForkLine_Click);

            #line default
            #line hidden
                return;

            case 7:
                this.drawViewScroll = ((System.Windows.Controls.ScrollViewer)(target));

            #line 97 "..\..\MainWindow.xaml"
                this.drawViewScroll.PreviewMouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.image_PreviewMouseWheel);

            #line default
            #line hidden

            #line 98 "..\..\MainWindow.xaml"
                this.drawViewScroll.PreviewMouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.imageRobot_PreviewMouseRightButtonDown);

            #line default
            #line hidden

            #line 99 "..\..\MainWindow.xaml"
                this.drawViewScroll.PreviewMouseMove += new System.Windows.Input.MouseEventHandler(this.imageRobot_PreviewMouseMove);

            #line default
            #line hidden

            #line 100 "..\..\MainWindow.xaml"
                this.drawViewScroll.PreviewMouseRightButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.imageRobot_PreviewMouseRightButtonUp);

            #line default
            #line hidden

            #line 101 "..\..\MainWindow.xaml"
                this.drawViewScroll.PreviewMouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.imageRobot_PreviewMouseLeftButtonDown);

            #line default
            #line hidden

            #line 102 "..\..\MainWindow.xaml"
                this.drawViewScroll.PreviewMouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.imageRobot_PreviewMouseLeftButtonUp);

            #line default
            #line hidden
                return;

            case 8:
                this.gridDraw = ((System.Windows.Controls.Grid)(target));
                return;

            case 9:
                this.sfr = ((System.Windows.Media.ScaleTransform)(target));
                return;

            case 10:
                this.tlt = ((System.Windows.Media.TranslateTransform)(target));
                return;

            case 11:
                this.cvGrid = ((System.Windows.Controls.Canvas)(target));
                return;

            case 12:
                this.cvMap = ((System.Windows.Controls.Canvas)(target));
                return;

            case 13:
                this.cvLine = ((System.Windows.Controls.Canvas)(target));
                return;

            case 14:
                this.cvForkLine = ((System.Windows.Controls.Canvas)(target));
                return;

            case 15:
                this.cvRFID = ((System.Windows.Controls.Canvas)(target));
                return;

            case 16:
                this.cvOperate = ((System.Windows.Controls.Canvas)(target));
                return;

            case 17:
                this.cbShowGrid = ((System.Windows.Controls.CheckBox)(target));

            #line 138 "..\..\MainWindow.xaml"
                this.cbShowGrid.Click += new System.Windows.RoutedEventHandler(this.CbShowGrid_Click);

            #line default
            #line hidden
                return;

            case 18:
                this.Btn_SaveMap = ((System.Windows.Controls.Button)(target));

            #line 139 "..\..\MainWindow.xaml"
                this.Btn_SaveMap.Click += new System.Windows.RoutedEventHandler(this.Btn_SaveMap_Click);

            #line default
            #line hidden
                return;

            case 19:
                this.Btn_SaveMapAs = ((System.Windows.Controls.Button)(target));

            #line 140 "..\..\MainWindow.xaml"
                this.Btn_SaveMapAs.Click += new System.Windows.RoutedEventHandler(this.Btn_SaveMapAs_Click);

            #line default
            #line hidden
                return;

            case 20:
                this.Btn_LoadMap = ((System.Windows.Controls.Button)(target));

            #line 141 "..\..\MainWindow.xaml"
                this.Btn_LoadMap.Click += new System.Windows.RoutedEventHandler(this.Btn_LoadMap_Click);

            #line default
            #line hidden
                return;

            case 21:

            #line 163 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.SaveButton_Click);

            #line default
            #line hidden
                return;

            case 22:

            #line 164 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.LoadButton_Click);

            #line default
            #line hidden
                return;

            case 23:
                this.tbSystemMsg = ((System.Windows.Controls.TextBox)(target));

            #line 190 "..\..\MainWindow.xaml"
                this.tbSystemMsg.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.TbSystemMsg_TextChanged);

            #line default
            #line hidden
                return;

            case 24:
                this.BtnClearMsg = ((System.Windows.Controls.Button)(target));

            #line 196 "..\..\MainWindow.xaml"
                this.BtnClearMsg.Click += new System.Windows.RoutedEventHandler(this.BtnClearMsg_Click);

            #line default
            #line hidden
                return;

            case 25:
                this.bottomsStatusBar = ((System.Windows.Controls.Primitives.StatusBar)(target));
                return;

            case 26:
                this.companyLink = ((System.Windows.Documents.Hyperlink)(target));

            #line 256 "..\..\MainWindow.xaml"
                this.companyLink.Click += new System.Windows.RoutedEventHandler(this.CompanyLink_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Ejemplo n.º 33
0
        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);
        }
Ejemplo n.º 34
0
 public LayoutEventArgs(LayoutRoot layoutRoot)
 {
     LayoutRoot = layoutRoot;
 }
 public void AfterInsertDocument(LayoutRoot layout, LayoutDocument anchorableShown)
 {
 }
Ejemplo n.º 36
0
        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
        }
Ejemplo n.º 37
0
        private object ReadElement(XmlReader reader)
        {
            while (reader.NodeType == XmlNodeType.Whitespace)
            {
                reader.Read();
            }

            if (reader.NodeType == XmlNodeType.EndElement)
            {
                return(null);
            }

            XmlSerializer serializer;

            switch (reader.LocalName)
            {
            case "LayoutAnchorablePaneGroup":
                serializer = new XmlSerializer(typeof(LayoutAnchorablePaneGroup));
                break;

            case "LayoutAnchorablePane":
                serializer = new XmlSerializer(typeof(LayoutAnchorablePane));
                break;

            case "LayoutAnchorable":
                serializer = new XmlSerializer(typeof(LayoutAnchorable));
                break;

            case "LayoutDocumentPaneGroup":
                serializer = new XmlSerializer(typeof(LayoutDocumentPaneGroup));
                break;

            case "LayoutDocumentPane":
                serializer = new XmlSerializer(typeof(LayoutDocumentPane));
                break;

            case "LayoutDocument":
                serializer = new XmlSerializer(typeof(LayoutDocument));
                break;

            case "LayoutAnchorGroup":
                serializer = new XmlSerializer(typeof(LayoutAnchorGroup));
                break;

            case "LayoutPanel":
                serializer = new XmlSerializer(typeof(LayoutPanel));
                break;

            case "LayoutDocumentFloatingWindow":
                serializer = new XmlSerializer(typeof(LayoutDocumentFloatingWindow));
                break;

            case "LayoutAnchorableFloatingWindow":
                serializer = new XmlSerializer(typeof(LayoutAnchorableFloatingWindow));
                break;

            case "LeftSide":
            case "RightSide":
            case "TopSide":
            case "BottomSide":
                if (reader.IsEmptyElement)
                {
                    reader.Read();
                    return(null);
                }
                return(reader.Read());

            default:
                var type = LayoutRoot.FindType(reader.LocalName);
                if (type == null)
                {
                    throw new ArgumentException("AvalonDock.LayoutRoot doesn't know how to deserialize " + reader.LocalName);
                }
                serializer = new XmlSerializer(type);
                break;
            }

            return(serializer.Deserialize(reader));
        }
Ejemplo n.º 38
0
        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();
                            previousContainer.DockMinWidth = this.AutoHideMinWidth;
                            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();
                            previousContainer.DockMinWidth = this.AutoHideMinWidth;
                            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();
                            previousContainer.DockMinHeight = this.AutoHideMinHeight;
                            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();
                            previousContainer.DockMinHeight = this.AutoHideMinHeight;
                            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);
                }

                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
        }
Ejemplo n.º 39
0
 public bool BeforeInsertDocument(LayoutRoot layout, LayoutDocument anchorableToShow, ILayoutContainer destinationContainer)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 40
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;
        }
 public bool BeforeInsertDocument(LayoutRoot layout, LayoutDocument anchorableToShow, ILayoutContainer destinationContainer)
 {
     return m_WrappedStrategy.BeforeInsertDocument(layout, anchorableToShow, destinationContainer);
 }
Ejemplo n.º 42
0
 public void AfterInsertDocument(LayoutRoot layout, LayoutDocument anchorableShown)
 {
     throw new NotImplementedException();
 }
 public void AfterInsertDocument(LayoutRoot layout, LayoutDocument anchorableShown)
 {
     m_WrappedStrategy.AfterInsertDocument(layout, anchorableShown);
 }
Ejemplo n.º 44
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 30 "..\..\Window1.xaml"
                ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.CommandBinding_Executed_ShowToolBar);

            #line default
            #line hidden
                return;

            case 2:

            #line 31 "..\..\Window1.xaml"
                ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.CommandBinding_Executed_HidenToolBar);

            #line default
            #line hidden
                return;

            case 3:
                this.miShowToolBar = ((System.Windows.Controls.MenuItem)(target));

            #line 45 "..\..\Window1.xaml"
                this.miShowToolBar.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 4:
                this.miHidenToolBar = ((System.Windows.Controls.MenuItem)(target));

            #line 46 "..\..\Window1.xaml"
                this.miHidenToolBar.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 5:
                this.miGetTemplateByLocal = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 6:
                this.miGetTemplateByDataBase = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 7:
                this.miManageTemplateType = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 8:
                this.miManageTemplate = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 9:
                this.miDebuging = ((System.Windows.Controls.MenuItem)(target));

            #line 57 "..\..\Window1.xaml"
                this.miDebuging.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 10:
                this.themeCombo = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 11:
                this._layoutRoot = ((Xceed.Wpf.AvalonDock.Layout.LayoutRoot)(target));
                return;

            case 12:
                this.expBookmark = ((System.Windows.Controls.Expander)(target));
                return;

            case 13:
                this.layoutDocumenPane = ((Xceed.Wpf.AvalonDock.Layout.LayoutDocumentPane)(target));
                return;

            case 14:

            #line 94 "..\..\Window1.xaml"
                ((Xceed.Wpf.AvalonDock.Layout.LayoutDocument)(target)).IsSelectedChanged += new System.EventHandler(this.NewLayoutDocument_IsSelectChange);

            #line default
            #line hidden
                return;

            case 15:
                this.grdMain = ((System.Windows.Controls.Grid)(target));
                return;

            case 16:
                this.toolBar = ((System.Windows.Controls.ContentControl)(target));
                return;

            case 17:
                this.DesignerScrollViewer = ((System.Windows.Controls.ScrollViewer)(target));
                return;

            case 18:
                this.MyDesigner = ((DiagramDesigner.DesignerCanvas)(target));
                return;

            case 19:
                this.zoomBox = ((Nsun.DiagramDesigner.Utils.ZoomBox)(target));
                return;

            case 20:

            #line 127 "..\..\Window1.xaml"
                ((Xceed.Wpf.AvalonDock.Layout.LayoutDocument)(target)).IsSelectedChanged += new System.EventHandler(this.NewLayoutDocument_IsSelectChange);

            #line default
            #line hidden
                return;

            case 21:
                this.txtCode = ((System.Windows.Controls.TextBox)(target));
                return;

            case 22:
                this.propertyGrid = ((WPG.PropertyGrid)(target));
                return;

            case 23:
                this.txbError = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 24:
                this.txbWaring = ((System.Windows.Controls.TextBlock)(target));
                return;
            }
            this._contentLoaded = true;
        }
 public void AfterInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableShown)
 {
     m_WrappedStrategy.AfterInsertAnchorable(layout, anchorableShown);
 }
 public bool BeforeInsertDocument(LayoutRoot layout, LayoutDocument anchorableToShow, ILayoutContainer destinationContainer)
 {
     return false;
 }
Ejemplo n.º 47
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.LayoutRoot = ((System.Windows.Controls.Grid)(target));
                return;

            case 2:
                this.RootVisual = ((System.Windows.Controls.Grid)(target));
                return;

            case 3:
                this.TopMenuGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 4:
                this.PlatformTitle = ((iS3.Client.Controls.RaisedText)(target));
                return;

            case 5:
                this.DocMan = ((Xceed.Wpf.AvalonDock.DockingManager)(target));
                return;

            case 6:
                this._layoutRoot = ((Xceed.Wpf.AvalonDock.Layout.LayoutRoot)(target));
                return;

            case 7:
                this.ProjectPane = ((Xceed.Wpf.AvalonDock.Layout.LayoutAnchorablePane)(target));
                return;

            case 8:
                this.projectBox = ((System.Windows.Controls.ListBox)(target));

            #line 81 "..\..\..\ProjectListPage\ProjectListNormal.xaml"
                this.projectBox.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.projectBox_SelectionChanged);

            #line default
            #line hidden
                return;

            case 9:
                this.MapPane = ((Xceed.Wpf.AvalonDock.Layout.LayoutDocumentPane)(target));
                return;

            case 10:
                this.MyMapView = ((Esri.ArcGISRuntime.Controls.MapView)(target));
                return;

            case 11:
                this.Map = ((Esri.ArcGISRuntime.Controls.Map)(target));
                return;

            case 12:
                this.ProjectGraphicsLayer = ((Esri.ArcGISRuntime.Layers.GraphicsLayer)(target));
                return;

            case 13:
                this.mapTip = ((System.Windows.Controls.Border)(target));
                return;

            case 14:
                this.ProjectTitle = ((iS3.Client.Controls.RaisedText)(target));
                return;

            case 15:
                this.MapCoordsTB = ((System.Windows.Controls.TextBlock)(target));
                return;
            }
            this._contentLoaded = true;
        }
 public void AfterInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableShown)
 {
 }
Ejemplo n.º 49
-1
        public bool BeforeInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableToShow, ILayoutContainer destinationContainer)
        {
            //AD wants to add the anchorable into destinationContainer
            //just for test provide a new anchorablepane
            //if the pane is floating let the manager go ahead
            //LayoutAnchorablePane destPane = destinationContainer as LayoutAnchorablePane;
            if (destinationContainer != null &&
                destinationContainer.FindParent<LayoutFloatingWindow>() != null)
                return false;

            var content = anchorableToShow.Content;
            string destPaneName = "";
            if(content is IdInfoTablePane2ViewModel)
            {
                destPaneName = "IdInfoTablePane";
                ////layout.BottomSide.InsertChildAt(0, anchorableToShow);
                //layout.BottomSide.Children[0].Children.Add(anchorableToShow);
                //return true;
            }
            else if(content is CategoryTreePaneViewModel)
            {
                destPaneName = "CategoryTreePane";
            }
            else if (content is WpfApplication1.Workspace.ParameterFileTreePaneViewModel)
            {
                destPaneName = "ParameterFileTreePane";
            }
            else if(content is FileSharePaneViewModel)
            {
                destPaneName = "FileSharePane";
            }
            else if(content is ParameterTab2ViewModel)
            {
                destPaneName = "ParameterTabPane";
            }
            else
            { return false; }

            foreach(var pane in layout.Descendents().OfType<LayoutAnchorablePane>().Where(p=>p.ChildrenCount  >= 1))
            {
                for (int i = 0; i < pane.ChildrenCount; ++i)
                {
                    var child = pane.Children[i];
                    if (child.Content == null)
                    {
                        child.IsVisible = false;
                        --i;
                    }
                }
            }

            var toolsPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == destPaneName);
            if (toolsPane != null)
            {
                toolsPane.Children.Add(anchorableToShow);
                return true;
            }

            return false;
        }