Example #1
0
        public MainView(IThemeProvider themeProvider)
        {
            if (themeProvider == null)
            {
                throw new ArgumentNullException(nameof(themeProvider));
            }


            InitializeComponent();

            this.messenger = new Messenger(this);

            this.settingsView = new SettingsView(themeProvider, messenger);
            this.settingsView.Show(this.dockPanel, DockState.DockLeft);
            this.dockPanel.DockLeftPortion = 400;

            var helpContentIndexProvider = new HelpContentIndexProvider();
            var helpContentIndex         = helpContentIndexProvider.GetIndex();
            var helpRepository           = new HelpRepository(helpContentIndex, GetType().Assembly);
            var helpView = new HelpView(this.messenger, this.outputView, helpRepository, Topics.Home);

            helpView.Show(this.dockPanel, DockState.DockRight);
            helpView.DockState = DockState.DockRightAutoHide;

            this.outputView = new OutputView(themeProvider, messenger);
            this.outputView.Show(this.dockPanel, DockState.Document);

            this.messenger.Register <Export>(OnExportRequested);
        }
Example #2
0
        public EnvironmentComparerPluginControl(IThemeProvider themeProvider)
        {
            if (themeProvider == null)
            {
                throw new ArgumentNullException(nameof(themeProvider));
            }


            InitializeComponent();

            this.messenger = new Messenger(this);

            this.tEnv1Name.Text      = "1. Connect to environment 1";
            this.tConnectToEnv2.Text = ConnectToEnvironment2String;


            this.outputView = new OutputView(themeProvider, messenger);
            this.outputView.Show(this.dockPanel, DockState.DockBottomAutoHide);

            this.viewModel = new EnvironmentComparerViewModel(this.messenger);
            var scheduler = new AsyncJobScheduler(this, viewModel);

            this.resultTreeView = new ResultTreeView(themeProvider, scheduler, this.messenger, this.outputView);
            this.resultTreeView.Show(this.dockPanel, DockState.DockLeft);

            this.configuratorView = new ConfiguratorView(themeProvider, scheduler, this.messenger, this.outputView);
            this.configuratorView.Show(this.dockPanel, DockState.DockLeft);

            this.resultGridView = new ResultGridView(themeProvider, this.messenger, this.outputView);
            this.resultGridView.Show(this.dockPanel, DockState.Document);

            this.resultRecordView = new ResultRecordView(themeProvider, this.messenger);
            this.resultRecordView.Show(this.dockPanel, DockState.Document);

            this.actionsView = new ActionsView(themeProvider, scheduler, this.messenger, this.outputView);
            this.actionsView.Show(this.dockPanel, DockState.Document);

            var helpContentIndexProvider = new HelpContentIndexProvider();
            var helpContentIndex         = helpContentIndexProvider.GetIndex();
            var helpRepository           = new HelpRepository(helpContentIndex, GetType().Assembly);
            var helpView = new HelpView(this.messenger, this.outputView, helpRepository, Topics.Home);

            helpView.Show(this.dockPanel, DockState.DockRight);
            helpView.DockState = DockState.DockRightAutoHide;
            // trick used because the DockState.AutoHide doesn't works well with browser control: the WebBrowser control "Dispose" method throws an exception if the form has not been loaded

            this.resultGridView.Show();
            this.configuratorView.Show();

            this.tEquals.Bind(_ => _.Visible, this.viewModel, _ => _.AreEqual);


            this.messenger.Register <HighlightResultRecord>(m =>
            {
                this.resultRecordView.Show();
            });
            this.messenger.Register <LoadEntitiesRequest>(m =>
            {
                ExecuteMethod(LoadEntities);
            });

            this.messenger.Register <StatusBarMessageEventArgs>(m =>
            {
                this.SendMessageToStatusBar?.Invoke(this, m);
            });
        }