Example #1
0
        public static Workspace LaunchAsWorkspace(
            IDesktopWindow desktopWindow,
            IApplicationComponent component,
            string title,
            ApplicationComponentExitDelegate exitCallback)
        {
            var args = new WorkspaceCreationArgs(component, title, null);

            return(LaunchAsWorkspace(desktopWindow, args, exitCallback));
        }
Example #2
0
        public static Shelf LaunchAsShelf(
            IDesktopWindow desktopWindow,
            IApplicationComponent component,
            string title,
            ShelfDisplayHint displayHint,
            ApplicationComponentExitDelegate exitCallback)
        {
            var args = new ShelfCreationArgs(component, title, null, displayHint);

            return(LaunchAsShelf(desktopWindow, args, exitCallback));
        }
Example #3
0
        /// <summary>
        /// Private helper method to support LaunchAsShelf
        /// </summary>
        private static Shelf LaunchAsShelf(
            IDesktopWindow desktopWindow,
            ShelfCreationArgs args,
            ApplicationComponentExitDelegate exitCallback)
        {
            var shelf = desktopWindow.Shelves.AddNew(args);

            if (exitCallback != null)
            {
                shelf.Closed += delegate { exitCallback(args.Component); };
            }
            return(shelf);
        }
Example #4
0
        public static Workspace LaunchAsWorkspace(
            IDesktopWindow desktopWindow,
            IApplicationComponent component,
            string title,
            string name,
            ApplicationComponentExitDelegate exitCallback)
        {
            Platform.CheckForNullReference(desktopWindow, "desktopWindow");
            Platform.CheckForNullReference(component, "component");

            var args = new WorkspaceCreationArgs(component, title, name);

            return(LaunchAsWorkspace(desktopWindow, args, exitCallback));
        }
Example #5
0
        public static Shelf LaunchAsShelf(
            IDesktopWindow desktopWindow,
            IApplicationComponent component,
            string title,
            string name,
            ShelfDisplayHint displayHint,
            ApplicationComponentExitDelegate exitCallback)
        {
            Platform.CheckForNullReference(desktopWindow, "desktopWindow");
            Platform.CheckForNullReference(component, "component");

            var args = new ShelfCreationArgs(component, title, name, displayHint);

            return(LaunchAsShelf(desktopWindow, args, exitCallback));
        }
Example #6
0
        /// <summary>
        /// Private helper method to support LaunchAsWorkspace.
        /// </summary>
        private static Workspace LaunchAsWorkspace(
            IDesktopWindow desktopWindow,
            WorkspaceCreationArgs creationArgs,
            ApplicationComponentExitDelegate exitCallback)
        {
            Platform.CheckForNullReference(desktopWindow, "desktopWindow");
            Platform.CheckForNullReference(creationArgs, "creationArgs");

            var workspace = desktopWindow.Workspaces.AddNew(creationArgs);

            if (exitCallback != null)
            {
                workspace.Closed += ((sender, e) => exitCallback(creationArgs.Component));
            }
            return(workspace);
        }