/// <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; } }
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); } }
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(); }
public AlertContext(DesktopWindow window) { _window = window; }
internal DesktopToolContext(DesktopWindow window) { _window = window; }
/// <summary> /// Creates a view for a desktop window. /// </summary> internal IDesktopWindowView CreateDesktopWindowView(DesktopWindow window) { return(_view.CreateDesktopWindowView(window)); }
internal ApplicationComponentMetaToolContext(ApplicationComponent component, DesktopWindow window) { _component = component; _window = window; }
private void HandleLink(DesktopWindow window, string message) { window.ShowMessageBox(message, MessageBoxActions.Ok); }
/// <summary> /// Constructor. /// </summary> internal ShelfCollection(DesktopWindow owner) { _owner = owner; }
/// <summary> /// Constructor /// </summary> /// <param name="owner"></param> internal WorkspaceCollection(DesktopWindow owner) { _owner = owner; }
public DialogBox CreateDialogBox(DialogBoxCreationArgs args, DesktopWindow window) { return(new DialogBox(args, window)); }
public Shelf CreateShelf(ShelfCreationArgs args, DesktopWindow window) { return(new Shelf(args, window)); }
public Workspace CreateWorkspace(WorkspaceCreationArgs args, DesktopWindow window) { return(new Workspace(args, window)); }
/// <summary> /// Constructor. /// </summary> /// <param name="owner">The <see cref="DesktopWindow"/> that owns the dialog box.</param> internal DialogBoxCollection(DesktopWindow owner) { _owner = owner; }