Beispiel #1
0
 public MainViewModel(
     IWebBrowser webBrowser,
     IJsReportProxy jsReportProxy,
     IHtmlProvider htmlProvider,
     IScriptManager scriptManager,
     IGenerator generator,
     IToaster toaster
     )
 {
     Settings = new SettingsViewModel(jsReportProxy, this);
     scriptManager.Initialize(this, Settings, this, jsReportProxy);
     webBrowser.ObjectForScripting = scriptManager;
     webBrowser.Navigate(htmlProvider.GetPath());
     this.generator       = generator;
     this.toaster         = toaster;
     this.jsReportProxy   = jsReportProxy;
     SelectProjectCommand = new RelayCommand <object>(_ =>
     {
         OpenFileDialog openFileDialog = new OpenFileDialog();
         openFileDialog.Filter         = "dll|*.dll";
         if (openFileDialog.ShowDialog() == true)
         {
             var dll  = openFileDialog.FileName;
             var name = System.IO.Path.GetFileNameWithoutExtension(dll);
             this.AddTestProject(new TestProject {
                 name = name, path = dll
             });
         }
     });
     ClearProjectsCommand = new RelayCommand <object>(_ =>
     {
         TestProjects.Clear();
         //going to mimic a new solution here
         jsReportProxy.ProjectsAdded(new TestProject[] { }, true);
     });
 }