public static IAlarmSystemSingleEntityConfigurationService <T> GetAlarmSingleEntityConfigurationService <T>() { AlarmSystemConfigManager man = FakeAlarmServiceFactory.GetAlarmConfigManager(); man.RemoteDevice = GetFakeAlarmDevice(); IAlarmSystemSingleEntityConfigurationService <T> service; var type = typeof(T); if (type == typeof(sconnDevice)) { service = new DeviceConfigService(man) as IAlarmSystemSingleEntityConfigurationService <T>; } else if (typeof(T) == typeof(sconnGlobalConfig)) { service = new GlobalConfigService(man) as IAlarmSystemSingleEntityConfigurationService <T>; } else { service = null; } if (service != null) { service.Online = false; //Disable online config sync for testing } return(service); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { var configService = new GlobalConfigService(); var globalConfig = configService.LoadConfig(Configuration); var userSessionsManager = new UserSessionsManager(); var labelsService = new LabelSorterService(); var histogramService = new HistogramSorterService(); var imageLabelsPath = Configuration["FilePaths:ImageLabelsPath"]; var colorHistogramsPath = Configuration["FilePaths:ColorHistogramFiles"]; var imageLabelsWrapper = new LoadedImageLabelsWrapper(labelsService.ParseLabels(imageLabelsPath)); var histogramsWrapper = new LoadedHistogramsWrapper(histogramService.ParseHistograms(colorHistogramsPath)); services.AddSingleton(globalConfig); services.AddSingleton(configService); services.AddSingleton(userSessionsManager); services.AddSingleton(labelsService); services.AddSingleton(histogramService); services.AddSingleton(imageLabelsWrapper); services.AddSingleton(histogramsWrapper); services.AddRazorPages(); }
public SyncMembersViewModel(ISettings settings) { _settings = new GlobalConfigService(settings); CanClose = true; Title = ViewModelsTitles.SYNC_MEMBERS; Errors = new Dictionary <string, List <string> >(); OnStateChanged(ViewModelState.AddNew); }
public AlarmGlobalConfigViewModel(IAlarmConfigManager manager, IRegionManager regionManager) { Config = new sconnGlobalConfig(); this._manager = (AlarmSystemConfigManager)manager; this._provider = new GlobalConfigService(_manager); this._regionManager = regionManager; GetData(); }
// GET: AlarmSystemView public ActionResult Edit(int ServerId) { try { var gprovider = new GlobalConfigService(DomainSession.GetAlarmConfigForContextWithDeviceId(this.HttpContext, ServerId)); AlarmSystemCommunicationEditModel model = new AlarmSystemCommunicationEditModel(gprovider.Get()); model.ServerId = ServerId; return(View(model)); } catch (Exception e) { } return(View()); }
public ActionResult Index(int ServerId) { try { this._provider = new GlobalConfigService(DomainSession.GetAlarmConfigForContextWithDeviceId(this.HttpContext, ServerId)); AlarmSystemGlobalModel model = new AlarmSystemGlobalModel(this._provider.Get()); model.ServerId = ServerId; return(View(model)); } catch (Exception e) { _logger.Error(e, e.Message); } return(View()); }
// GET: AlarmSystemMap public ActionResult Edit(int ServerId) { try { var gprovider = new GlobalConfigService(DomainSession.GetAlarmConfigForContextWithDeviceId(this.HttpContext, ServerId)); var deviceprovider = new AlarmDevicesConfigService(DomainSession.GetAlarmConfigForContextWithDeviceId(this.HttpContext, ServerId)); AlarmSystemMapEditModel model = new AlarmSystemMapEditModel(gprovider.Get(), deviceprovider.GetAll()); model.ServerId = ServerId; return(View(model)); } catch (Exception e) { _logger.Error(e, e.Message); } return(View()); }
public PaymentTransViewModel(ILogger logger, ISettings settings) { if (logger == null) { throw new ArgumentNullException(nameof(logger)); } if (settings == null) { throw new ArgumentNullException(nameof(settings)); } _logger = logger; _settings = new GlobalConfigService(settings); CanClose = true; Title = ViewModelsTitles.PAYMENT_TRANS; Errors = new Dictionary <string, List <string> >(); Initialize(); }
public LoanDetailsViewModel(ISettings settings, IEventAggregator eventAggregator, ILogger logger) { if (settings == null) { throw new ArgumentNullException(nameof(settings)); } if (eventAggregator == null) { throw new ArgumentNullException(nameof(eventAggregator)); } _eventAggregator = eventAggregator; _settings = new GlobalConfigService(settings); _logger = logger; _selectedLoanFiredOnInitialzation = true; _unitOfWork = new FamilyContext(); eventAggregator.GetEvent <LoanSelectedEvent>().Subscribe(OnLoanSelected); Errors = new Dictionary <string, List <string> >(); Initialize(); }
public OptionsViewModel(ISettings settings) { _settings = new GlobalConfigService(settings); Initialize(); }
public AlarmGlobalConfigViewModel() { _name = "Gcfg"; this._provider = new GlobalConfigService(_manager); }
public AlarmCommConfigViewModel() { _name = "Auth"; this._provider = new GlobalConfigService(Manager); }