コード例 #1
0
ファイル: DockableContent.cs プロジェクト: rudzen/AvalonDock
        /// <summary>
        /// Show the content ad floating window
        /// </summary>
        /// <param name="dockableWindow">True if the resulting floating window can the be re-docked to the docking manager.</param>
        public void ShowAsFloatingWindow(DockingManager manager, bool dockableWindow)
        {
            if (Manager != null && Manager != manager)
            {
                throw new InvalidOperationException("Please remove the content from previous DockingManager (using the Close method)");
            }

            //Manager = manager;

            if (manager == null)
            {
                if (dockableWindow &&
                    !CanExecuteCommand(DockableContentCommands.DockableFloatingWindow))
                {
                    throw new InvalidOperationException("This operation can be executed in this state");
                }
                if (!dockableWindow &&
                    !CanExecuteCommand(DockableContentCommands.FloatingWindow))
                {
                    throw new InvalidOperationException("This operation can be executed in this state");
                }
            }

            manager.Show(this, dockableWindow ? DockableContentState.DockableWindow : DockableContentState.FloatingWindow);
        }
コード例 #2
0
ファイル: DocumentContent.cs プロジェクト: dangtq72/BDS
        /// <summary>
        /// Show <see cref="DocumentContent"/> as tabbed document inside the provided <see cref="DockingManager"/>
        /// </summary>
        /// <param name="manager">Docking manager target</param>
        /// <param name="showAsFloatingWindow">True if document should be shown inside a floating window (<see cref="DocumentFloatingWindow"/>)</param>
        public void Show(DockingManager manager, bool showAsFloatingWindow)
        {
            if (Manager != null && Manager != manager)
            {
                throw new InvalidOperationException("Please remove the content from previous DockingManager (using the Close method)");
            }

            if (!CanExecuteCommand(ManagedContentCommands.Show))
            {
                throw new InvalidOperationException("This operation can be executed in this state");
            }

            manager.Show(this, showAsFloatingWindow);
            manager.Documents.Add(this);
        }
コード例 #3
0
ファイル: NavigatorWindow.cs プロジェクト: daisy/tobi
        protected override void OnDeactivated(EventArgs e)
        {
            if (_manager != null)
            {
                Window mainWindow = Window.GetWindow(_manager);
                if (mainWindow != null)
                {
                    mainWindow.Activate();
                    if (SelectedContent != null)
                    {
                        _manager.Show(SelectedContent.ItemContent as DocumentContent);
                        SelectedContent.ItemContent.SetAsActive();
                    }
                    else if (SelectedToolWindow != null)
                    {
                        _manager.Show(SelectedToolWindow.ItemContent as DockableContent);
                        SelectedToolWindow.ItemContent.SetAsActive();
                    }
                }
            }
            Hide();

            base.OnDeactivated(e);
        }
コード例 #4
0
        /// <summary>
        /// Show as <see cref="DockableContent"/> as a tabbed document under the provided <see cref="DockingManager"/>
        /// </summary>
        public void ShowAsDocument(DockingManager manager)
        {
            if (Manager != null && Manager != manager)
            {
                throw new InvalidOperationException("Please remove the content from previous DockingManager (using the Close method)");
            }

            //Manager = manager;

            if (manager == null && !CanExecuteCommand(DockableContentCommands.ShowAsDocument))
            {
                throw new InvalidOperationException("This operation can be executed in this state");
            }

            manager.Show(this, DockableContentState.Document);
        }
コード例 #5
0
        protected override void OnDeactivated(EventArgs e)
        {
            if (_manager != null)
            {
                Window mainWindow = Window.GetWindow(_manager);
                if (mainWindow != null)
                {
                    mainWindow.Activate();
                    if (SelectedContent != null)
                    {
                        _manager.Show(SelectedContent.ItemContent as DocumentContent);
                        SelectedContent.ItemContent.SetAsActive();
                    }
                }
            }

            if (!_isClosing)
            {
                CloseThisWindow();// Hide();
            }
            base.OnDeactivated(e);
        }
コード例 #6
0
        /// <summary>
        /// Show <see cref="DocumentContent"/> as tabbed document inside the provided <see cref="DockingManager"/>
        /// </summary>
        /// <param name="manager">Docking manager target</param>
        /// <param name="showAsFloatingWindow">True if document should be shown inside a floating window (<see cref="DocumentFloatingWindow"/>)</param>
        public void Show(DockingManager manager, bool showAsFloatingWindow)
        {
            if (Manager != null && Manager != manager)
                throw new InvalidOperationException("Please remove the content from previous DockingManager (using the Close method)");

            if (!CanExecuteCommand(ManagedContentCommands.Show))
                throw new InvalidOperationException("This operation can be executed in this state");

            manager.Show(this, showAsFloatingWindow);

            manager.Documents.Add(this);
        }
コード例 #7
0
        /// <summary>
        /// Show the content ad floating window
        /// </summary>
        /// <param name="dockableWindow">True if the resulting floating window can the be re-docked to the docking manager.</param>
        public void ShowAsFloatingWindow(DockingManager manager, bool dockableWindow)
        {
            if (Manager != null && Manager != manager)
                throw new InvalidOperationException("Please remove the content from previous DockingManager (using the Close method)");

            //Manager = manager;

            if (manager == null)
            {
                if (dockableWindow &&
                    !CanExecuteCommand(DockableContentCommands.DockableFloatingWindow))
                    throw new InvalidOperationException("This operation can be executed in this state");
                if (!dockableWindow &&
                    !CanExecuteCommand(DockableContentCommands.FloatingWindow))
                    throw new InvalidOperationException("This operation can be executed in this state");
            }

            manager.Show(this, dockableWindow ? DockableContentState.DockableWindow : DockableContentState.FloatingWindow);
        }
コード例 #8
0
        /// <summary>
        /// Show as <see cref="DockableContent"/> as a tabbed document under the provided <see cref="DockingManager"/>
        /// </summary>
        public void ShowAsDocument(DockingManager manager)
        {
            if (Manager != null && Manager != manager)
                throw new InvalidOperationException("Please remove the content from previous DockingManager (using the Close method)");

            //Manager = manager; 

            if (manager == null && !CanExecuteCommand(DockableContentCommands.ShowAsDocument))
                throw new InvalidOperationException("This operation can be executed in this state");

            manager.Show(this, DockableContentState.Document);
        }
コード例 #9
0
        /// <summary>
        /// Show <see cref="DockableContent"/> as docked pane
        /// </summary>
        public void Show(DockingManager manager, AnchorStyle desideredAnchor)
        {
            if (Manager != null && Manager != manager)
                throw new InvalidOperationException("Please remove the content from previous DockingManager (using the Close method)");

            if (manager == null && !CanExecuteCommand(ManagedContentCommands.Show))
                throw new InvalidOperationException("This operation can be executed in this state");

            if (State == DockableContentState.Docked)
            {
                //if already shown as docked content just activate it
                Activate();
            }
            else
            {
                if (SavedStateAndPosition != null && State == DockableContentState.Hidden)
                    manager.Show(this, SavedStateAndPosition.State, desideredAnchor);
                else
                    manager.Show(this, DockableContentState.Docked, desideredAnchor);
            }
        }