public GraphCodeWindowRegistrar(Lifetime lifetime, ToolWindowManager toolWindowManager,
                                     GraphCodeToolWindow descriptor, UIApplication environment)
 {
     _environment = environment;
     _lifetime = lifetime;
     
     _toolWindowClass = toolWindowManager.Classes[descriptor];
     //_toolWindowClass.RegisterEmptyContent(
     //  lifetime,
     //  lt =>
     //  {
     //      var graphs = (new GraphLoader()).Load();
     //      var tabControl = new System.Windows.Controls.TabControl();
     //      var zcontrols = new List<ZoomControl>();
     //      foreach (var graph in graphs)
     //      {
     //          var gArea = InitializeGraphArea.Initialize(graph);
     //          var zcontrol = new ZoomControl();
     //          zcontrol.Content = gArea;
     //          zcontrols.Add(zcontrol);
     //      }
     //      tabControl.ItemsSource = zcontrols;
     //      return (new EitherControl(tabControl)).BindToLifetime(lt);
     //  });
 }
    public TypeInterfaceToolWindowRegistrar(Lifetime lifetime,
                                    ToolWindowManager toolWindowManager,
                                    IShellLocks locks,
                                    ISettingsStore settingsStore,
                                    IActionManager actionManager,
                                    IActionBarManager actionBarManager,
                                    IShortcutManager shortcutManager,
                                    TypeInterfaceToolWindowDescriptor toolWindowDescriptor,
                                    ITheming theming,
                                    IThemedIconManager themedIconManager, IColorThemeManager colorThemeManager)
    {
      myLifetime = lifetime;
      myLocks = locks;
      mySettingsStore = settingsStore;
      myActionBarManager = actionBarManager;
      myTheming = theming;
      myThemedIconManager = themedIconManager;
      myColorThemeManager = colorThemeManager;

      myToolWindowClass = toolWindowManager.Classes[toolWindowDescriptor];
      myToolWindowClass.RegisterEmptyContent(
        lifetime,
        lt =>
          {
            var emptyLabel = new RichTextLabel { BackColor = SystemColors.Control, Dock = DockStyle.Fill };
            emptyLabel.RichTextBlock.Add(new RichText("No hierarchies open", new TextStyle(FontStyle.Bold)));
            emptyLabel.RichTextBlock.Add(
              new RichText("Use " + actionManager.GetHowToExecuteAction(shortcutManager, typeof(BrowseTypeHierarchyAction)), TextStyle.Default));
            emptyLabel.RichTextBlock.Add(new RichText("on a type to see hierarchy", TextStyle.Default));
            emptyLabel.RichTextBlock.Parameters = new RichTextBlockParameters(8, ContentAlignment.MiddleCenter);
            return emptyLabel.BindToLifetime(lt);
          });
    }
        public TypeInterfaceToolWindowRegistrar(Lifetime lifetime,
                                                ToolWindowManager toolWindowManager,
                                                IShellLocks locks,
                                                ISettingsStore settingsStore,
                                                IActionManager actionManager,
                                                IActionBarManager actionBarManager,
                                                IShortcutManager shortcutManager,
                                                TypeInterfaceToolWindowDescriptor toolWindowDescriptor,
                                                ITheming theming,
                                                IThemedIconManager themedIconManager, IColorThemeManager colorThemeManager)
        {
            myLifetime          = lifetime;
            myLocks             = locks;
            mySettingsStore     = settingsStore;
            myActionBarManager  = actionBarManager;
            myTheming           = theming;
            myThemedIconManager = themedIconManager;
            myColorThemeManager = colorThemeManager;

            myToolWindowClass = toolWindowManager.Classes[toolWindowDescriptor];
            myToolWindowClass.RegisterEmptyContent(
                lifetime,
                lt =>
            {
                var emptyLabel = new RichTextLabel {
                    BackColor = SystemColors.Control, Dock = DockStyle.Fill
                };
                emptyLabel.RichTextBlock.Add(new RichText("No hierarchies open", new TextStyle(FontStyle.Bold)));
                emptyLabel.RichTextBlock.Add(
                    new RichText("Use " + actionManager.GetHowToExecuteAction(shortcutManager, typeof(BrowseTypeHierarchyAction)), TextStyle.Default));
                emptyLabel.RichTextBlock.Add(new RichText("on a type to see hierarchy", TextStyle.Default));
                emptyLabel.RichTextBlock.Parameters = new RichTextBlockParameters(8, ContentAlignment.MiddleCenter);
                return(emptyLabel.BindToLifetime(lt));
            });
        }
Beispiel #4
0
        public TypeInterfaceToolWindowRegistrar(Lifetime lifetime,
                                                ToolWindowManager toolWindowManager,
                                                IActionManager actionManager,
                                                IActionBarManager actionBarManager,
                                                IShortcutManager shortcutManager,
                                                TypeInterfaceToolWindowDescriptor toolWindowDescriptor,
                                                IUIApplication environment,
                                                IWindowsHookManager windowsHookManager)
        {
            _lifetime           = lifetime;
            _actionBarManager   = actionBarManager;
            _environment        = environment;
            _windowsHookManager = windowsHookManager;

            _toolWindowClass = toolWindowManager.Classes[toolWindowDescriptor];
            _toolWindowClass.RegisterEmptyContent(
                lifetime,
                lt =>
            {
                var emptyLabel = new RichTextLabel(environment)
                {
                    BackColor = SystemColors.Control, Dock = DockStyle.Fill
                };
                emptyLabel.RichTextBlock.Add(new RichText("No hierarchies open", new TextStyle(FontStyle.Bold)));
                emptyLabel.RichTextBlock.Add(
                    new RichText("Use " + actionManager.GetHowToExecuteAction(shortcutManager, typeof(BrowseTypeHierarchyAction)), TextStyle.Default));
                emptyLabel.RichTextBlock.Add(new RichText("on a type to see hierarchy", TextStyle.Default));
                emptyLabel.RichTextBlock.Parameters = new RichTextBlockParameters(8, ContentAlignment.MiddleCenter);
                return(emptyLabel.BindToLifetime(lt));
            });
        }
Beispiel #5
0
        public GraphCodeWindowRegistrar(Lifetime lifetime, ToolWindowManager toolWindowManager,
                                        GraphCodeToolWindow descriptor, UIApplication environment)
        {
            _environment = environment;
            _lifetime    = lifetime;

            _toolWindowClass = toolWindowManager.Classes[descriptor];
            //_toolWindowClass.RegisterEmptyContent(
            //  lifetime,
            //  lt =>
            //  {
            //      var graphs = (new GraphLoader()).Load();
            //      var tabControl = new System.Windows.Controls.TabControl();
            //      var zcontrols = new List<ZoomControl>();
            //      foreach (var graph in graphs)
            //      {
            //          var gArea = InitializeGraphArea.Initialize(graph);
            //          var zcontrol = new ZoomControl();
            //          zcontrol.Content = gArea;
            //          zcontrols.Add(zcontrol);
            //      }
            //      tabControl.ItemsSource = zcontrols;
            //      return (new EitherControl(tabControl)).BindToLifetime(lt);
            //  });
        }
 public ActiveTaskWindowRegistrar(Lifetime lifetime, ToolWindowManager toolWindowManager,
                                  ActiveTaskWindowDescriptor descriptor, TaskViewModel viewModel)
 {
     _toolWindowClass = toolWindowManager.Classes[descriptor];
     _toolWindowClass.RegisterEmptyContent(lifetime,
                                           lt =>
     {
         var control = new ActiveTaskWindow(viewModel);
         var wrapper = new EitherControl(control);
         return(wrapper.BindToLifetime(lt));
     }
                                           );
 }
 public MainNavigationRegistrar(Lifetime lifetime, ToolWindowManager toolWindowManager,
                                MainNavigationDescriptor descriptor, TaskViewModel viewModel, IconsSettingsRepository settingsRepository)
 {
     Directory.CreateDirectory(PersistenceConstants.AppFolder);
     _toolWindowClass = toolWindowManager.Classes[descriptor];
     _toolWindowClass.RegisterEmptyContent(
         lifetime,
         lt =>
     {
         var control = new MainNavigationControl(viewModel);
         var wrapper = new EitherControl(control);
         return(wrapper.BindToLifetime(lt));
     });
 }
        public YouTrackExplorerWindowRegistrar(Lifetime lifetime, ToolWindowManager toolWindowManager,
                                        YouTrackExplorerWindowDescriptor descriptor)
        {
            this.lifetime = lifetime;

              toolWindowClass = toolWindowManager.Classes[descriptor];
              toolWindowClass.RegisterEmptyContent(
            lifetime,
            lt =>
            {
              // initialize the default ('empty') content for the tool window
              var label = new RichTextLabel { BackColor = SystemColors.Control, Dock = DockStyle.Fill };
              label.RichTextBlock.Add(new RichText("Nothing Here", new TextStyle(FontStyle.Bold)));
              label.RichTextBlock.Parameters = new RichTextBlockParameters(8, ContentAlignment.MiddleCenter);
              return label.BindToLifetime(lt);
            });
        }
Beispiel #9
0
        public YouTrackExplorerWindowRegistrar(Lifetime lifetime, ToolWindowManager toolWindowManager,
                                               YouTrackExplorerWindowDescriptor descriptor, IUIApplication application)
        {
            this.lifetime    = lifetime;
            this.application = application;

            toolWindowClass = toolWindowManager.Classes[descriptor];
            toolWindowClass.RegisterEmptyContent(
                lifetime,
                lt =>
            {
                // initialize the default ('empty') content for the tool window
                var label = new RichTextLabel(application)
                {
                    BackColor = SystemColors.Control, Dock = DockStyle.Fill
                };
                label.RichTextBlock.Add(new RichText("Nothing Here", new TextStyle(FontStyle.Bold)));
                label.RichTextBlock.Parameters = new RichTextBlockParameters(8, ContentAlignment.MiddleCenter);
                return(label.BindToLifetime(lt));
            });
        }
Beispiel #10
0
 public SessionManagerWindowRegistrar(Lifetime lifetime,
                                      ToolWindowManager toolWindowManager,
                                      SessionManagerWindowDescriptor descriptor,
                                      ActionExecutor actionExecutor,
                                      ILogManager logManager,
                                      IExporter exporter,
                                      ISettingsStore settingsStore)
 {
     // objects are kept in fields to prevent garbage collection
     _toolWindowClass = toolWindowManager.Classes[descriptor];
     _toolWindowClass.RegisterEmptyContent(
         lifetime,
         lt =>
     {
         var visibilitySignal = _toolWindowClass.Visible.Change;
         var control          = new SessionManagerControl(
             new FeedbackViewModel(logManager, exporter),
             actionExecutor,
             settingsStore);
         visibilitySignal.Advise(lt, control.OnVisibilityChanged);
         var wrapper = new EitherControl(control);
         return(wrapper.BindToLifetime(lt));
     });
 }
Beispiel #11
0
        public TutorialWindow(string contentPath, Lifetime lifetime, ISolution solution, IPsiFiles psiFiles,
                              TextControlManager textControlManager, IShellLocks shellLocks, IEditorManager editorManager,
                              DocumentManager documentManager, IUIApplication environment, IActionManager actionManager,
                              ToolWindowManager toolWindowManager, TutorialWindowDescriptor toolWindowDescriptor,
                              IWindowsHookManager windowsHookManager, IPsiServices psiServices, IActionShortcuts shortcutManager,
                              IColorThemeManager colorThemeManager)
        {
            _lifetime          = lifetime;
            _solution          = solution;
            _actionManager     = actionManager;
            _shellLocks        = shellLocks;
            _psiServices       = psiServices;
            _shortcutManager   = shortcutManager;
            _colorThemeManager = colorThemeManager;
            _toolWindowClass   = toolWindowManager.Classes[toolWindowDescriptor];

            if (solution.GetComponent <ISolutionOwner>().IsRealSolutionOwner)
            {
                var toolWindowInstance = _toolWindowClass.RegisterInstance(
                    lifetime, null, null,
                    (lt, twi) =>
                {
                    var containerControl = new TutorialPanel(environment).BindToLifetime(lt);

                    var viewControl = new HtmlViewControl(windowsHookManager, actionManager)
                    {
                        Dock = DockStyle.Fill,
                    }.BindToLifetime(lt);

                    var buttonNext = new Button
                    {
                        Text           = "Next",
                        Anchor         = AnchorStyles.Bottom | AnchorStyles.Right,
                        FlatStyle      = FlatStyle.Flat,
                        FlatAppearance = { BorderColor = Color.Gray, BorderSize = 1 }
                    };

                    lt.AddBracket(
                        () => _buttonNext = buttonNext,
                        () => _buttonNext = null);

                    _buttonNext.Top  = containerControl.Height - _buttonNext.Height - 10;
                    _buttonNext.Left = containerControl.Width - _buttonNext.Width - 25;

                    lt.AddBracket(
                        () => _containerControl = containerControl,
                        () => _containerControl = null);

                    lt.AddBracket(
                        () => _viewControl = viewControl,
                        () => _viewControl = null);

                    lt.AddBracket(
                        () => { _buttonNext.Click += NextStep; },
                        () => { _buttonNext.Click -= NextStep; });

                    lt.AddBracket(
                        () => _containerControl.Controls.Add(_buttonNext),
                        () => _containerControl.Controls.Remove(_buttonNext));

                    lt.AddBracket(
                        () => _containerControl.Controls.Add(_viewControl),
                        () => _containerControl.Controls.Remove(_viewControl));

                    _colorThemeManager.ColorThemeChanged.Advise(lifetime, RefreshKeepContent);

                    SetColors();

                    return(new EitherControl(lt, containerControl));
                });

                _toolWindowClass.QueryCloseInstances.Advise(_lifetime, args => { Close(); });    // not working

                _stepPresenter = new TutorialStepPresenter(this, contentPath, lifetime, solution, psiFiles, textControlManager,
                                                           shellLocks, editorManager, documentManager, environment, actionManager, psiServices, shortcutManager);
            }
        }