Example #1
0
        bool IJob.Initialize(IServiceProvider serviceProvider)
        {
            _settings   = serviceProvider.GetService <ISettingsServiceInternal>();
            _addressing = serviceProvider.GetService <IAddressingServiceInternal>();

            return(true);
        }
Example #2
0
        bool IJob.Initialize(IServiceProvider serviceProvider)
        {
            _settings = serviceProvider.GetService <ISettingsServiceInternal>();
            _emk      = serviceProvider.GetService <IEmkServiceInternal>();

            return(true);
        }
Example #3
0
        bool IJob.Initialize(IServiceProvider serviceProvider)
        {
            _settings = serviceProvider.GetService <ISettingsServiceInternal>();

            string settingString = _settings.GetSetting("DisplayWakeUpJob", "DisplayConfiguration").GetValue <string>();

            _configurations.AddRange(DisplayConfiguration.ParseSettingString(settingString));

            if (_configurations.Count == 0)
            {
                Logger.Instance.LogFormat(LogType.Error, this, Properties.Resources.NoConfigurationsFoundError);
                return(false);
            }

            _autoSleepAfterMinutes = _settings.GetSetting("DisplayWakeUpJob", "TurnOffTimeout").GetValue <int>();
            if (_autoSleepAfterMinutes > 0)
            {
                _autoSleepTimerThread              = new Thread(AutoSleepTimerThread);
                _autoSleepTimerThread.Name         = "Auto-sleep timer thread";
                _autoSleepTimerThread.Priority     = ThreadPriority.BelowNormal;
                _autoSleepTimerThread.IsBackground = true;
                _autoSleepTimerThread.Start();
            }

            _ignoreErrorInResponse = _settings.GetSetting("DisplayWakeUpJob", "IgnoreErrorInResponse").GetValue <bool>();

            return(true);
        }
Example #4
0
        bool IJob.Initialize(IServiceProvider serviceProvider)
        {
            _settings = serviceProvider.GetService<ISettingsServiceInternal>();
            _addressing = serviceProvider.GetService<IAddressingServiceInternal>();

            return true;
        }
Example #5
0
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 protected override void DisposeCore()
 {
     if (_settings != null)
     {
         _settings = null;
     }
 }
Example #6
0
        private static Configuration LoadConfiguration(ISettingsServiceInternal settings)
        {
            Configuration configuration = new Configuration();

            configuration.EnabledAlarmSources = new ReadOnlyCollection <string>(settings.GetSetting(SettingKeys.AlarmSourcesConfigurationKey).GetValue <ExportConfiguration>().GetEnabledExports());
            return(configuration);
        }
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 protected override void DisposeCore()
 {
     if (_settings != null)
     {
         _settings = null;
     }
 }
Example #8
0
        bool IJob.Initialize(IServiceProvider serviceProvider)
        {
            _settings   = serviceProvider.GetService <ISettingsServiceInternal>();
            _addressing = serviceProvider.GetService <IAddressingServiceInternal>();

            _expression = _settings.GetSetting("PushJob", "MessageContent").GetValue <string>();
            return(true);
        }
Example #9
0
        void IAlarmSource.Initialize(IServiceProvider serviceProvider)
        {
            _settings = serviceProvider.GetService <ISettingsServiceInternal>();

            int outputPort = _settings.GetSetting(NetworkSettingKeys.OutputPort).GetValue <int>();

            _server = new AlarmServer(this, outputPort);
        }
Example #10
0
        bool IJob.Initialize(IServiceProvider serviceProvider)
        {
            _settings = serviceProvider.GetService<ISettingsServiceInternal>();
            _addressing = serviceProvider.GetService<IAddressingServiceInternal>();

            _expression = _settings.GetSetting("PushJob", "MessageContent").GetValue<string>();
            return true;
        }
Example #11
0
        bool IJob.Initialize(IServiceProvider serviceProvider)
        {
            _settings = serviceProvider.GetService <ISettingsServiceInternal>();
            _settings.SettingChanged += (sender, args) => InitializeProvider();

            InitializeProvider();

            return(true);
        }
Example #12
0
        void IDisposable.Dispose()
        {
            if (_server.IsRunning)
            {
                _server.Stop();
            }

            _settings = null;
        }
Example #13
0
        bool IJob.Initialize(IServiceProvider serviceProvider)
        {
            _settings = serviceProvider.GetService<ISettingsServiceInternal>();
            _addressing = serviceProvider.GetService<IAddressingServiceInternal>();

            _provider = ExportedTypeLibrary.Import<ISmsProvider>(_settings.GetSetting(SettingKeys.Provider).GetValue<string>());

            return true;
        }
Example #14
0
        bool IJob.Initialize(IServiceProvider serviceProvider)
        {
            _settings   = serviceProvider.GetService <ISettingsServiceInternal>();
            _addressing = serviceProvider.GetService <IAddressingServiceInternal>();

            _provider = ExportedTypeLibrary.Import <ISmsProvider>(_settings.GetSetting(SettingKeys.Provider).GetValue <string>());

            return(true);
        }
Example #15
0
        /// <summary>
        /// Initializes a new instance of the <see cref="JobManager"/> class.
        /// </summary>
        /// <param name="serviceProvider">The service provider used for retrieving server-side services.</param>
        public JobManager(IServiceProvider serviceProvider)
            : this()
        {
            Assertions.AssertNotNull(serviceProvider, "serviceProvider");

            _serviceProvider = serviceProvider;

            _settingsService = _serviceProvider.GetService <ISettingsServiceInternal>();
            _settingsService.SettingChanged += SettingsService_OnSettingChanged;
        }
        bool IJob.Initialize(IServiceProvider serviceProvider)
        {
            _settings = serviceProvider.GetService<ISettingsServiceInternal>();

            _loopsFilePath = _settings.GetSetting("OperationLoopFetcherJob", "LoopsFilePath").GetValue<string>();
            _maxEntryAge = TimeSpan.FromSeconds(_settings.GetSetting("OperationLoopFetcherJob", "MaxEntryAge").GetValue<int>());
            _entryDateTimeFormat = _settings.GetSetting("OperationLoopFetcherJob", "EntryDateTimeFormat").GetValue<string>();

            return true;
        }
        bool IJob.Initialize(IServiceProvider serviceProvider)
        {
            _settings = serviceProvider.GetService <ISettingsServiceInternal>();

            _loopsFilePath       = _settings.GetSetting("OperationLoopFetcherJob", "LoopsFilePath").GetValue <string>();
            _maxEntryAge         = TimeSpan.FromSeconds(_settings.GetSetting("OperationLoopFetcherJob", "MaxEntryAge").GetValue <int>());
            _entryDateTimeFormat = _settings.GetSetting("OperationLoopFetcherJob", "EntryDateTimeFormat").GetValue <string>();

            return(true);
        }
Example #18
0
        /// <summary>
        /// Initializes a new instance of the <see cref="JobManager"/> class.
        /// </summary>
        /// <param name="serviceProvider">The service provider used for retrieving server-side services.</param>
        public JobManager(IServiceProvider serviceProvider)
            : this()
        {
            Assertions.AssertNotNull(serviceProvider, "serviceProvider");

            _serviceProvider = serviceProvider;

            _settingsService = _serviceProvider.GetService<ISettingsServiceInternal>();
            _settingsService.SettingChanged += SettingsService_OnSettingChanged;
        }
Example #19
0
        /// <summary>
        /// Called when the parent service is iterating through all services to signal them they can start.
        /// Overridden to start the engine immediately.
        /// </summary>
        public override void OnStart()
        {
            base.OnStart();

            ISettingsServiceInternal settings = this.ServiceProvider.GetService <ISettingsServiceInternal>();

            Configuration configuration = LoadConfiguration(settings);

            _engine = new AlarmWorkflowEngine(configuration, this.ServiceProvider, settings);
            _engine.Start();
        }
        /// <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;
        }
Example #21
0
        bool IJob.Initialize(IServiceProvider serviceProvider)
        {
            _settings   = serviceProvider.GetService <ISettingsServiceInternal>();
            _addressing = serviceProvider.GetService <IAddressingServiceInternal>();

            _userName = _settings.GetSetting("SMSJob", "UserName").GetValue <string>();
            _password = _settings.GetSetting("SMSJob", "Password").GetValue <string>();
            _provider = ExportedTypeLibrary.Import <ISmsProvider>(_settings.GetSetting("SMSJob", "Provider").GetValue <string>());

            return(true);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="FaxConfiguration"/> class.
        /// </summary>
        /// <param name="serviceProvider"></param>
        public FaxConfiguration(IServiceProvider serviceProvider)
        {
            _settings = serviceProvider.GetService <ISettingsServiceInternal>();

            this.FaxPath             = _settings.GetSetting("FaxAlarmSource", "FaxPath").GetValue <string>();
            this.ArchivePath         = _settings.GetSetting("FaxAlarmSource", "ArchivePath").GetValue <string>();
            this.AnalysisPath        = _settings.GetSetting("FaxAlarmSource", "AnalysisPath").GetValue <string>();
            this.AlarmFaxParserAlias = _settings.GetSetting("FaxAlarmSource", "AlarmfaxParser").GetValue <string>();

            this.OCRSoftwarePath = _settings.GetSetting("FaxAlarmSource", "OCR.Path").GetValue <string>();
        }
        /// <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;
        }
Example #24
0
        bool IJob.Initialize(IServiceProvider serviceProvider)
        {
            _settings = serviceProvider.GetService<ISettingsServiceInternal>();

            _provider = ExportedTypeLibrary.Import<IGeoCoder>(_settings.GetSetting("Geocoding", "Provider").GetValue<string>());
            if (_provider.ApiKeyRequired)
            {
                string apikey = _settings.GetSetting("Geocoding", "ApiKey").GetValue<string>();
                _provider.ApiKey = apikey;
            }
            return true;
        }
Example #25
0
        bool IJob.Initialize(IServiceProvider serviceProvider)
        {
            _settings = serviceProvider.GetService <ISettingsServiceInternal>();

            _provider = ExportedTypeLibrary.Import <IGeoCoder>(_settings.GetSetting("Geocoding", "Provider").GetValue <string>());
            if (_provider.ApiKeyRequired)
            {
                string apikey = _settings.GetSetting("Geocoding", "ApiKey").GetValue <string>();
                _provider.ApiKey = apikey;
            }
            return(true);
        }
Example #26
0
        void IAlarmSource.Initialize(IServiceProvider serviceProvider)
        {
            _settings = serviceProvider.GetService<ISettingsServiceInternal>();

            string smsParserAlias = _settings.GetSetting("SmsAlarmSource", "SMSParser").GetValue<string>();

            _parser = ExportedTypeLibrary.Import<IParser>(smsParserAlias);
            if (_parser == null)
            {
                Logger.Instance.LogFormat(LogType.Error, this, Properties.Resources.SmsParserNotFoundError, smsParserAlias);
                _parser = new DefaultSMSParser();
            }
        }
Example #27
0
        void IAlarmSource.Initialize(IServiceProvider serviceProvider)
        {
            _settings = serviceProvider.GetService <ISettingsServiceInternal>();

            string smsParserAlias = _settings.GetSetting(SmsSettingKeys.SmsParser).GetValue <string>();

            _parser = ExportedTypeLibrary.Import <IParser>(smsParserAlias);
            if (_parser == null)
            {
                Logger.Instance.LogFormat(LogType.Error, this, Properties.Resources.SmsParserNotFoundError, smsParserAlias);
                _parser = new DefaultSMSParser();
            }
        }
Example #28
0
        bool IJob.Initialize(IServiceProvider serviceProvider)
        {
            _settings = serviceProvider.GetService<ISettingsServiceInternal>();

            _provider = ExportedTypeLibrary.Import<IGeoCoder>(_settings.GetSetting(SettingKeysJob.Provider).GetValue<string>());

            if (_provider.IsApiKeyRequired)
            {
                _provider.ApiKey = _settings.GetSetting(SettingKeysJob.ApiKey).GetValue<string>();
            }

            return true;
        }
Example #29
0
        bool IJob.Initialize(IServiceProvider serviceProvider)
        {
            _settings = serviceProvider.GetService <ISettingsServiceInternal>();

            _provider = ExportedTypeLibrary.Import <IGeoCoder>(_settings.GetSetting(SettingKeysJob.Provider).GetValue <string>());

            if (_provider.IsApiKeyRequired)
            {
                _provider.ApiKey = _settings.GetSetting(SettingKeysJob.ApiKey).GetValue <string>();
            }

            return(true);
        }
Example #30
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FaxConfiguration"/> class.
        /// </summary>
        /// <param name="serviceProvider"></param>
        public FaxConfiguration(IServiceProvider serviceProvider)
        {
            _settings = serviceProvider.GetService<ISettingsServiceInternal>();

            this.FaxPath = _settings.GetSetting("FaxAlarmSource", "FaxPath").GetValue<string>();
            this.ArchivePath = _settings.GetSetting("FaxAlarmSource", "ArchivePath").GetValue<string>();
            this.AnalysisPath = _settings.GetSetting("FaxAlarmSource", "AnalysisPath").GetValue<string>();
            this.AlarmFaxParserAlias = _settings.GetSetting("FaxAlarmSource", "AlarmfaxParser").GetValue<string>();

            this.OCRSoftware = _settings.GetSetting("FaxAlarmSource", "OCR.Software").GetValue<string>();
            this.OCRSoftwarePath = _settings.GetSetting("FaxAlarmSource", "OCR.Path").GetValue<string>();

            this.RoutineInterval = _settings.GetSetting("FaxAlarmSource", "Routine.Interval").GetValue<int>();
            this.TestFaxKeywords = new ReadOnlyCollection<string>(_settings.GetSetting("FaxAlarmSource", "TestFaxKeywords").GetValue<string>().Split(new[] { '\n', ';' }, StringSplitOptions.RemoveEmptyEntries));
        }
Example #31
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FaxConfiguration"/> class.
        /// </summary>
        /// <param name="serviceProvider"></param>
        public FaxConfiguration(IServiceProvider serviceProvider)
        {
            _settings = serviceProvider.GetService <ISettingsServiceInternal>();

            this.FaxPath             = _settings.GetSetting("FaxAlarmSource", "FaxPath").GetValue <string>();
            this.ArchivePath         = _settings.GetSetting("FaxAlarmSource", "ArchivePath").GetValue <string>();
            this.AnalysisPath        = _settings.GetSetting("FaxAlarmSource", "AnalysisPath").GetValue <string>();
            this.AlarmFaxParserAlias = _settings.GetSetting("FaxAlarmSource", "AlarmfaxParser").GetValue <string>();

            this.OCRSoftware     = _settings.GetSetting("FaxAlarmSource", "OCR.Software").GetValue <string>();
            this.OCRSoftwarePath = _settings.GetSetting("FaxAlarmSource", "OCR.Path").GetValue <string>();

            this.RoutineInterval = _settings.GetSetting("FaxAlarmSource", "Routine.Interval").GetValue <int>();
            this.TestFaxKeywords = new ReadOnlyCollection <string>(_settings.GetSetting("FaxAlarmSource", "TestFaxKeywords").GetValue <string>().Split(new[] { '\n', ';' }, StringSplitOptions.RemoveEmptyEntries));
        }
Example #32
0
        /// <summary>
        /// Called when the parent service is iterating through all services to signal them they can start.
        /// Overridden to start the engine immediately.
        /// </summary>
        public override void OnStart()
        {
            base.OnStart();

            ISettingsServiceInternal settings = ServiceProvider.GetService <ISettingsServiceInternal>();

            Configuration configuration = LoadConfiguration(settings);

            AddInternalService(typeof(IAlarmFilter), new AlarmFilter()
            {
                Configuration = configuration
            });

            _engine = new AlarmWorkflowEngine(configuration, ServiceProvider, settings);
            _engine.Start();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="MailConfiguration"/> class.
        /// </summary>
        /// <param name="serviceProvider">The service provider.</param>
        public MailConfiguration(IServiceProvider serviceProvider)
        {
            _settings = serviceProvider.GetService <ISettingsServiceInternal>();

            ServerName   = _settings.GetSetting("MailAlarmSource", "ServerName").GetValue <string>();
            Port         = (ushort)_settings.GetSetting("MailAlarmSource", "Port").GetValue <int>();
            UserName     = _settings.GetSetting("MailAlarmSource", "UserName").GetValue <string>();
            Password     = _settings.GetSetting("MailAlarmSource", "Password").GetValue <string>();
            PollInterval = _settings.GetSetting("MailAlarmSource", "PollInterval").GetValue <int>();
            SSL          = _settings.GetSetting("MailAlarmSource", "SSL").GetValue <bool>();

            MailSubject = _settings.GetSetting("MailAlarmSource", "MailSubject").GetValue <string>();
            MailSender  = _settings.GetSetting("MailAlarmSource", "MailSender").GetValue <string>();

            AnalyseAttachment = _settings.GetSetting("MailAlarmSource", "AnalyseAttachment").GetValue <bool>();
            AttachmentName    = _settings.GetSetting("MailAlarmSource", "AttachmentName").GetValue <string>();
            ParserAlias       = _settings.GetSetting("MailAlarmSource", "MailParser").GetValue <string>();
        }
Example #34
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MailConfiguration"/> class.
        /// </summary>
        /// <param name="serviceProvider">The service provider.</param>
        public MailConfiguration(IServiceProvider serviceProvider)
        {
            _settings = serviceProvider.GetService<ISettingsServiceInternal>();

            ServerName = _settings.GetSetting("MailAlarmSource", "ServerName").GetValue<string>();
            Port = (ushort)_settings.GetSetting("MailAlarmSource", "Port").GetValue<int>();
            UserName = _settings.GetSetting("MailAlarmSource", "UserName").GetValue<string>();
            Password = _settings.GetSetting("MailAlarmSource", "Password").GetValue<string>();
            PollInterval = _settings.GetSetting("MailAlarmSource", "PollInterval").GetValue<int>();
            SSL = _settings.GetSetting("MailAlarmSource", "SSL").GetValue<bool>();

            MailSubject = _settings.GetSetting("MailAlarmSource", "MailSubject").GetValue<string>();
            MailSender = _settings.GetSetting("MailAlarmSource", "MailSender").GetValue<string>();

            AnalyseAttachment = _settings.GetSetting("MailAlarmSource", "AnalyseAttachment").GetValue<bool>();
            AttachmentName = _settings.GetSetting("MailAlarmSource", "AttachmentName").GetValue<string>();
            ParserAlias = _settings.GetSetting("MailAlarmSource", "MailParser").GetValue<string>();
        }
Example #35
0
        bool IJob.Initialize(IServiceProvider serviceProvider)
        {
            _settings = serviceProvider.GetService<ISettingsServiceInternal>();
            _addressing = serviceProvider.GetService<IAddressingServiceInternal>();

            string smtpHostName = _settings.GetSetting("MailingJob", "HostName").GetValue<string>();
            string userName = _settings.GetSetting("MailingJob", "UserName").GetValue<string>();
            string userPassword = _settings.GetSetting("MailingJob", "Password").GetValue<string>();
            int smtpPort = _settings.GetSetting("MailingJob", "Port").GetValue<int>();
            bool smtpAuthenticate = _settings.GetSetting("MailingJob", "Authenticate").GetValue<bool>();
            bool useSsl = _settings.GetSetting("MailingJob", "UseSsl").GetValue<bool>();

            _senderEmail = Helpers.ParseAddress(_settings.GetSetting("MailingJob", "SenderAddress").GetValue<string>());
            if (_senderEmail == null)
            {
                Logger.Instance.LogFormat(LogType.Warning, this, Properties.Resources.NoSenderAddressMessage);
                return false;
            }

            _smptClient = new SmtpClient(smtpHostName, smtpPort);
            _smptClient.EnableSsl = useSsl;
            if (smtpAuthenticate)
            {
                _smptClient.Credentials = new NetworkCredential(userName, userPassword);
            }

            _mailBodyFormat = _settings.GetSetting("MailingJob", "EMailBody").GetValue<string>();
            _mailSubject = _settings.GetSetting("MailingJob", "EMailSubject").GetValue<string>();
            if (string.IsNullOrWhiteSpace(_mailSubject))
            {
                _mailSubject = _settings.GetSetting("Shared", "FD.Name").GetValue<string>() + " - Neuer Alarm";
            }

            _attachImage = _settings.GetSetting("MailingJob", "AttachImage").GetValue<bool>();

            return true;
        }
Example #36
0
        bool IJob.Initialize(IServiceProvider serviceProvider)
        {
            _settings   = serviceProvider.GetService <ISettingsServiceInternal>();
            _addressing = serviceProvider.GetService <IAddressingServiceInternal>();

            string smtpHostName     = _settings.GetSetting("MailingJob", "HostName").GetValue <string>();
            string userName         = _settings.GetSetting("MailingJob", "UserName").GetValue <string>();
            string userPassword     = _settings.GetSetting("MailingJob", "Password").GetValue <string>();
            int    smtpPort         = _settings.GetSetting("MailingJob", "Port").GetValue <int>();
            bool   smtpAuthenticate = _settings.GetSetting("MailingJob", "Authenticate").GetValue <bool>();
            bool   useSsl           = _settings.GetSetting("MailingJob", "UseSsl").GetValue <bool>();

            _senderEmail = Helpers.ParseAddress(_settings.GetSetting("MailingJob", "SenderAddress").GetValue <string>());
            if (_senderEmail == null)
            {
                Logger.Instance.LogFormat(LogType.Warning, this, Properties.Resources.NoSenderAddressMessage);
                return(false);
            }

            _smptClient           = new SmtpClient(smtpHostName, smtpPort);
            _smptClient.EnableSsl = useSsl;
            if (smtpAuthenticate)
            {
                _smptClient.Credentials = new NetworkCredential(userName, userPassword);
            }

            _mailBodyFormat = _settings.GetSetting("MailingJob", "EMailBody").GetValue <string>();
            _mailSubject    = _settings.GetSetting("MailingJob", "EMailSubject").GetValue <string>();
            if (string.IsNullOrWhiteSpace(_mailSubject))
            {
                _mailSubject = _settings.GetSetting("Shared", "FD.Name").GetValue <string>() + " - Neuer Alarm";
            }

            _attachImage = _settings.GetSetting("MailingJob", "AttachImage").GetValue <bool>();

            return(true);
        }
Example #37
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Configuration"/> class.
 /// </summary>
 /// <param name="serviceProvider">The service provider to use.</param>
 public Configuration(IServiceProvider serviceProvider)
 {
     _settings = serviceProvider.GetService<ISettingsServiceInternal>();
 }
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 protected override void DisposeCore()
 {
     _settings.SettingChanged -= _settings_SettingChanged;
     _settings = null;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="Configuration"/> class.
 /// </summary>
 /// <param name="serviceProvider">The service provider to use.</param>
 public Configuration(IServiceProvider serviceProvider)
 {
     _settings = serviceProvider.GetService <ISettingsServiceInternal>();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="FaxConfiguration"/> class.
 /// </summary>
 /// <param name="serviceProvider"></param>
 public FaxConfiguration(IServiceProvider serviceProvider)
 {
     _settings = serviceProvider.GetService<ISettingsServiceInternal>();
     _settings.SettingChanged += _settings_SettingChanged;
 }
Example #41
0
 public bool Initialize(IServiceProvider serviceProvider)
 {
     _settings = serviceProvider.GetService <ISettingsServiceInternal>();
     return(true);
 }
 private static Configuration LoadConfiguration(ISettingsServiceInternal settings)
 {
     Configuration configuration = new Configuration();
     configuration.EnabledAlarmSources = new ReadOnlyCollection<string>(settings.GetSetting(SettingKeys.AlarmSourcesConfigurationKey).GetValue<ExportConfiguration>().GetEnabledExports());
     return configuration;
 }
Example #43
0
        bool IJob.Initialize(IServiceProvider serviceProvider)
        {
            _settings = serviceProvider.GetService<ISettingsServiceInternal>();
            _addressing = serviceProvider.GetService<IAddressingServiceInternal>();

            _userName = _settings.GetSetting("SMSJob", "UserName").GetValue<string>();
            _password = _settings.GetSetting("SMSJob", "Password").GetValue<string>();
            _provider = ExportedTypeLibrary.Import<ISmsProvider>(_settings.GetSetting("SMSJob", "Provider").GetValue<string>());

            return true;
        }
Example #44
0
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 protected override void DisposeCore()
 {
     _settings.SettingChanged -= _settings_SettingChanged;
     _settings = null;
 }
Example #45
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FaxConfiguration"/> class.
 /// </summary>
 /// <param name="serviceProvider"></param>
 public FaxConfiguration(IServiceProvider serviceProvider)
 {
     _settings = serviceProvider.GetService <ISettingsServiceInternal>();
     _settings.SettingChanged += _settings_SettingChanged;
 }
 void IDisposable.Dispose()
 {
     _settings = null;
 }
 void IDisposable.Dispose()
 {
     _settings = null;
 }
Example #48
0
 void IDisposable.Dispose()
 {
     _server.Stop();
     _settings = null;
 }
Example #49
0
 void IDisposable.Dispose()
 {
     _server.Stop();
     _settings = null;
 }
        bool IJob.Initialize(IServiceProvider serviceProvider)
        {
            _settings = serviceProvider.GetService<ISettingsServiceInternal>();

            string settingString = _settings.GetSetting("DisplayWakeUpJob", "DisplayConfiguration").GetValue<string>();
            _configurations.AddRange(DisplayConfiguration.ParseSettingString(settingString));

            if (_configurations.Count == 0)
            {
                Logger.Instance.LogFormat(LogType.Error, this, Properties.Resources.NoConfigurationsFoundError);
                return false;
            }

            _autoSleepAfterMinutes = _settings.GetSetting("DisplayWakeUpJob", "TurnOffTimeout").GetValue<int>();
            if (_autoSleepAfterMinutes > 0)
            {
                _autoSleepTimerThread = new Thread(AutoSleepTimerThread);
                _autoSleepTimerThread.Name = "Auto-sleep timer thread";
                _autoSleepTimerThread.Priority = ThreadPriority.BelowNormal;
                _autoSleepTimerThread.IsBackground = true;
                _autoSleepTimerThread.Start();
            }

            _ignoreErrorInResponse = _settings.GetSetting("DisplayWakeUpJob", "IgnoreErrorInResponse").GetValue<bool>();

            return true;
        }