Exemple #1
0
        /// <summary>
        /// Stops the hosted component.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (disposing && _host != null)
            {
                _host.StopComponent();
                _host = null;

                if (_dialogBoxes != null)
                {
                    (_dialogBoxes as IDisposable).Dispose();
                }
                _dialogBoxes   = null;
                _desktopWindow = null;
            }
        }
Exemple #2
0
        private void WindowClosingEventHandler(object sender, ClosingEventArgs e)
        {
            // if interaction not allowed, or already cancelled, don't do anything here
            if (e.Interaction != UserInteraction.Allowed || e.Cancel)
            {
                return;
            }

            // find all the workspaces that can't be closed
            DesktopWindow window     = (DesktopWindow)sender;
            bool          showHelper = CollectionUtils.Contains <Workspace>(window.Workspaces,
                                                                            delegate(Workspace w) { return(!w.QueryCloseReady()); });

            if (showHelper)
            {
                e.Cancel = true;
                ShowShelf(window);
            }
        }
Exemple #3
0
        private void ShowShelf(DesktopWindow window)
        {
            // the shelf is not currently open
            if (_closeHelperShelf == null)
            {
                // launch it
                CloseHelperComponent component = new CloseHelperComponent();
                _closeHelperShelf = ApplicationComponent.LaunchAsShelf(window, component,
                                                                       SR.TitleCloseAssistant,
                                                                       "Close Assistant",
                                                                       ShelfDisplayHint.DockLeft);
                _closeHelperShelf.Closed += delegate { _closeHelperShelf = null; };
            }
            else
            {
                _closeHelperShelf.Activate();
            }

            CloseHelperComponent helper = (CloseHelperComponent)_closeHelperShelf.Component;

            helper.Refresh();
        }
Exemple #4
0
 public AlertContext(DesktopWindow window)
 {
     _window = window;
 }
Exemple #5
0
 internal DesktopToolContext(DesktopWindow window)
 {
     _window = window;
 }
Exemple #6
0
 /// <summary>
 /// Creates a view for a desktop window.
 /// </summary>
 internal IDesktopWindowView CreateDesktopWindowView(DesktopWindow window)
 {
     return(_view.CreateDesktopWindowView(window));
 }
Exemple #7
0
 internal ApplicationComponentMetaToolContext(ApplicationComponent component, DesktopWindow window)
 {
     _component = component;
     _window    = window;
 }
Exemple #8
0
 private void HandleLink(DesktopWindow window, string message)
 {
     window.ShowMessageBox(message, MessageBoxActions.Ok);
 }
Exemple #9
0
 /// <summary>
 /// Constructor.
 /// </summary>
 internal ShelfCollection(DesktopWindow owner)
 {
     _owner = owner;
 }
Exemple #10
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="owner"></param>
 internal WorkspaceCollection(DesktopWindow owner)
 {
     _owner = owner;
 }
Exemple #11
0
 public DialogBox CreateDialogBox(DialogBoxCreationArgs args, DesktopWindow window)
 {
     return(new DialogBox(args, window));
 }
Exemple #12
0
 public Shelf CreateShelf(ShelfCreationArgs args, DesktopWindow window)
 {
     return(new Shelf(args, window));
 }
Exemple #13
0
 public Workspace CreateWorkspace(WorkspaceCreationArgs args, DesktopWindow window)
 {
     return(new Workspace(args, window));
 }
Exemple #14
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="owner">The <see cref="DesktopWindow"/> that owns the dialog box.</param>
 internal DialogBoxCollection(DesktopWindow owner)
 {
     _owner = owner;
 }