/// <summary> /// Initializes a new instance of the <see cref="AlarmWorkflowEngine"/> class. /// </summary> /// <param name="configuration">The configuration.</param> /// <param name="serviceProvider"></param> /// <param name="settings"></param> public AlarmWorkflowEngine(Configuration configuration, IServiceProvider serviceProvider, ISettingsServiceInternal settings) : this() { Assertions.AssertNotNull(configuration, "configuration"); Assertions.AssertNotNull(serviceProvider, "serviceProvider"); Assertions.AssertNotNull(settings, "settings"); _configuration = configuration; _serviceProvider = serviceProvider; _settingsService = settings; _operationService = serviceProvider.GetService<IOperationServiceInternal>(); }
/// <summary> /// Initializes a new instance of the <see cref="AlarmWorkflowEngine"/> class. /// </summary> /// <param name="configuration">The configuration.</param> /// <param name="serviceProvider"></param> /// <param name="settings"></param> public AlarmWorkflowEngine(Configuration configuration, IServiceProvider serviceProvider, ISettingsServiceInternal settings) : this() { Assertions.AssertNotNull(configuration, "configuration"); Assertions.AssertNotNull(serviceProvider, "serviceProvider"); Assertions.AssertNotNull(settings, "settings"); _configuration = configuration; _serviceProvider = serviceProvider; _settingsService = settings; _operationService = serviceProvider.GetService <IOperationServiceInternal>(); }
private Operation StoreOperation(Operation operation) { try { IOperationServiceInternal operationService = _serviceProvider.GetService <IOperationServiceInternal>(); return(operationService.StoreOperation(operation)); } catch (Exception ex) { Logger.Instance.LogFormat(LogType.Error, this, Resources.NewAlarmStoreOperationFailedMessage); Logger.Instance.LogException(this, ex); return(null); } }