public SitesViewModel(ISiteDataService siteDataService, IConfigurationService configurationService) { _siteDataService = siteDataService; _configurationService = configurationService; _siteDataService.PropertyChanged += (s,e) => { if (e.PropertyName == "Sites") { this.SiteFilter = String.Empty; this.SelectedSite = this.Sites.FirstOrDefault(); } }; this.LoadNgrokInspector = new RelayCommand(() => { Process.Start("http://localhost:4040/"); }); this.RunNgrokCommand = new RelayCommand(() => { Process p = new Process(); p.StartInfo = new ProcessStartInfo( "cmd.exe" ) { Arguments = string.Format("/k \"{0}\" http -subdomain={1} {2}", Path.Combine(_configurationService.ApplicationConfiguration.NgrokExecutablePath, "ngrok.exe"), this.SelectedSite.Subdomain, this.SelectedSite.LocalhostPort), UseShellExecute = true, WindowStyle = ProcessWindowStyle.Normal }; p.Start(); }); this.SiteFilter = String.Empty; }
public SitesViewModel(ISiteDataService siteDataService, IConfigurationService configurationService) { _siteDataService = siteDataService; _configurationService = configurationService; _siteDataService.PropertyChanged += (s, e) => { if (e.PropertyName == "Sites") { this.SiteFilter = String.Empty; this.SelectedSite = this.Sites.FirstOrDefault(); } }; this.LoadNgrokInspector = new RelayCommand(() => { Process.Start("http://localhost:4040/"); }); this.RunNgrokCommand = new RelayCommand(() => { Process p = new Process(); p.StartInfo = new ProcessStartInfo("cmd.exe") { Arguments = string.Format("/k \"{0}\" http -subdomain={1} {2}", Path.Combine(_configurationService.ApplicationConfiguration.NgrokExecutablePath, "ngrok.exe"), this.SelectedSite.Subdomain, this.SelectedSite.LocalhostPort), UseShellExecute = true, WindowStyle = ProcessWindowStyle.Normal }; p.Start(); }); this.SiteFilter = String.Empty; }
public SiteDataController(ISiteDataService service, IMapper mapper) { if (service == null) { throw new ArgumentNullException(nameof(service)); } if (mapper == null) { throw new ArgumentNullException(nameof(mapper)); } _service = service; _mapper = mapper; }