private void Init() { if (!_initialised) { lock (_initlock) { if (!_initialised) { IPropertyReaderFactory readerFactory = DefaultServiceLocator.GetService <IPropertyReaderFactory>(); _initialised = true; _filePathReader = readerFactory.CreateCombinedReader(FilePath); _outputReader = readerFactory.CreateCombinedReader(Output); _writerCache = DefaultServiceLocator.GetService <IStreamWriterCache>(); try { SafeParseCleanInterval(); } // need to start the timer with the default value, even if this throws finally { Timer timer = new Timer(_cleanInterval.TotalMilliseconds); timer.Elapsed += new ElapsedEventHandler(timer_Elapsed); timer.Start(); } } } } }
private void InternalConfigure(IPropertyReaderFactory readerFactory, ISmtpService smtpService, string host, int port, string username, string password, string to, string from, string subjectValueToken, string bodyValueToken) { SmtpService = smtpService; SmtpService.Initialize(host, port, username, password); From = from; To = to; SubjectReader = readerFactory.CreateCombinedReader(subjectValueToken); BodyReader = readerFactory.CreateCombinedReader(bodyValueToken); }