Exemple #1
0
 /// <summary>
 /// Show the alert viewer shelf.
 /// </summary>
 public void Show()
 {
     if (_shelf == null)
     {
         _shelf = ApplicationComponent.LaunchAsShelf(
             this.Context.DesktopWindow,
             new AlertViewerComponent(),
             SR.TitleAlertViewer,
             ShelfName,
             ShelfDisplayHint.DockRight | ShelfDisplayHint.DockAutoHide);
         _shelf.Closed += (sender, args) => _shelf = null;
     }
     else
     {
         _shelf.Activate();
     }
 }
        void Shelf2()
        {
            if (_shelf2 == null)
            {
                TestComponent component = new TestComponent("Shelf2");
                _shelf2 = ApplicationComponent.LaunchAsShelf(
                    this.Context.DesktopWindow,
                    component,
                    "Shelf 2",
                    "Shelf2",
                    ShelfDisplayHint.DockFloat);

                _shelf2.Closed += delegate { _shelf2 = null; };
            }
            else
            {
                _shelf2.Activate();
            }
        }
        void Shelf1()
        {
            if (_shelf1 == null)
            {
                TestComponent component = new TestComponent("Shelf1");
                _shelf1 = ApplicationComponent.LaunchAsShelf(
                    this.Context.DesktopWindow,
                    component,
                    "Shelf 1",
                    "Shelf1",
                    ShelfDisplayHint.DockFloat | ShelfDisplayHint.DockLeft | ShelfDisplayHint.HideOnWorkspaceOpen);

                _shelf1.Closed += delegate { _shelf1 = null; };
            }
            else
            {
                _shelf1.Activate();
            }
        }
        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 #5
0
 internal Host(Shelf shelf, IApplicationComponent component)
     : base(component)
 {
     Platform.CheckForNullReference(shelf, "shelf");
     _shelf = shelf;
 }
 /// <summary>
 /// Creates a shelf view for the specified shelf.
 /// </summary>
 internal IShelfView CreateShelfView(Shelf shelf)
 {
     return(this.DesktopWindowView.CreateShelfView(shelf));
 }