Example #1
0
        public IViewAdaper <ConnectionInfoView, ViewResult> GetConnectionInfoView(IProjectManager projectManager, IProjectConfigurationManager configurationManager)
        {
            var viewModel = new ConnectionInfoViewModel(authManager, this, configurationManager, projectManager);
            var view      = new ConnectionInfoView();

            view.DataContext = viewModel;

            AttachToParentWindow(view);
            return(new ConnectionInfoViewAdapter(view));
        }
Example #2
0
 private void ShowConnectionInfoView()
 {
     if (connectionInfoView == null)
     {
         connectionInfoView          = new ConnectionInfoView(new ConnectionInfoViewModel(serviceManager));
         connectionInfoView.Closing += (sender, e) => connectionInfoView = null;
         connectionInfoView.Show();
     }
     else
     {
         connectionInfoView.Activate();
     }
 }
Example #3
0
        public void ExecuteCommandImpl_ShouldReceivedGetConnectionInfoView()
        {
            // Arrange
            var view    = new ConnectionInfoView();
            var adapter = Substitute.For <ConnectionInfoViewAdapter>(view);

            dialogFactory.GetConnectionInfoView(projectManager, projectConfigurationManager).Returns(adapter);

            //Act
            сonnectionInfoCmd.ExecuteCommandImpl(null, null);

            // Assert
            dialogFactory.Received().GetConnectionInfoView(projectManager, projectConfigurationManager);
        }
        public IViewAdaper <ConnectionInfoView, ViewResult> GetConnectionInfoView(IProjectManager projectManager, IProjectConfigurationManager configurationManager)
        {
            var projectConfiguration = configurationManager.Load(projectManager.ProjectConfigPath);

            var viewModel = new ConnectionInfoViewModel(authManager, this, configurationManager, projectManager, projectConfiguration);
            var view      = new ConnectionInfoView();

            view.DataContext = viewModel;

            IntPtr hwnd;

            projectManager.UIShell.GetDialogOwnerHwnd(out hwnd);
            var windowInteropHelper = new WindowInteropHelper(view);

            windowInteropHelper.Owner = hwnd;

            return(new ConnectionInfoViewAdapter(view));
        }