Inheritance: ITrigger, IDisposable
コード例 #1
0
        public void Setup()
        {
            _folderPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));
            _filePath = Path.Combine(_folderPath, "test.txt");
            Directory.CreateDirectory(_folderPath);

            _trigger = new FolderChangedTrigger(_folderPath, "*.*");
            _trigger.Attach(this);
        }
コード例 #2
0
        public RazorMailTemplateEngine(RazorTemplatesFactory templatesFactory, bool autoReloadTemplates)
        {
            _templatesFactory = templatesFactory;

            if (autoReloadTemplates)
            {
                _folderChangedTrigger = new FolderChangedTrigger(templatesFactory.TemplatesFolderPath, "*.cshtml");
                _folderChangedTrigger.Attach(templatesFactory);
                _folderChangedTrigger.Start();
            }
        }