public AppViewModel(BackendService <UserT> backend) : base(backend) { // when editing this will // select uniflow default _editApp = new App(); _editApp.Type = "uniflow"; _editApp.OwnedBy = _backend.Permit.User; ApplicationTypes = new ObservableCollection <AppType> { new AppType { Name = "Uniflow", Description = "A Web Server", Image = "webnet32.png", Tag = "uniflow" }, new AppType { Name = "Biflow", Description = "A Websocket Server", Image = "websocketnet32.png", Tag = "biflow" } }; _contactViewModel = new ContactViewModel <UserT>(_backend, _editApp); _nestViewModel = new NestViewModel <UserT>(_backend, _editApp); _domainViewModel = new DomainViewModel <UserT>(_backend, _editApp); _deploymentViewModel = new DeploymentViewModel <UserT>(_backend, _editApp); _servicesViewModel = new ServicesViewModel <UserT>(_backend, _editApp); BackendService <UserT> appBackend = new BackendService <UserT>(); appBackend.Version = backend.Version; appBackend.DeviceSignature = backend.DeviceSignature; _logViewModel = new LogViewModel <UserT>(appBackend, _editApp); }
public void CreateServicesTables() { ResetAppServiceTable(); AppServiceSubscription subscription; SelectedStorageServiceTableItem = null; subscription = _editApp.Subscriptions.FirstOrDefault( x => (x.ServiceTier.OwnedBy as AppService).Type == "storage"); if (subscription != null) { SelectedStorageServiceTableItem = ServicesViewModel <UserT> .CreateServiceTableItem( subscription.ServiceTier); } SelectedDomainServiceTableItem = null; subscription = _editApp.Subscriptions.FirstOrDefault( x => (x.ServiceTier.OwnedBy as AppService).Type == "domain"); if (subscription != null) { SelectedDomainServiceTableItem = ServicesViewModel <UserT> .CreateServiceTableItem( subscription.ServiceTier); } SelectedMonitorServiceTableItem = null; subscription = _editApp.Subscriptions.FirstOrDefault( x => (x.ServiceTier.OwnedBy as AppService).Type == "monitor"); if (subscription != null) { SelectedMonitorServiceTableItem = ServicesViewModel <UserT> .CreateServiceTableItem( subscription.ServiceTier); } SelectedBatchServiceTableItem = null; subscription = _editApp.Subscriptions.FirstOrDefault( x => (x.ServiceTier.OwnedBy as AppService).Type == "batch"); if (subscription != null) { SelectedBatchServiceTableItem = ServicesViewModel <UserT> .CreateServiceTableItem( subscription.ServiceTier); } SelectedTrackServiceTableItem = null; subscription = _editApp.Subscriptions.FirstOrDefault( x => (x.ServiceTier.OwnedBy as AppService).Type == "track"); if (subscription != null) { SelectedTrackServiceTableItem = ServicesViewModel <UserT> .CreateServiceTableItem( subscription.ServiceTier); } SelectedBuildServiceTableItem = null; subscription = _editApp.Subscriptions.FirstOrDefault( x => (x.ServiceTier.OwnedBy as AppService).Type == "build"); if (subscription != null) { SelectedBuildServiceTableItem = ServicesViewModel <UserT> .CreateServiceTableItem( subscription.ServiceTier); } }