Пример #1
0
        public EffectPluginTester()
        {
            InitializeComponent();

            reader       = new PluginReader();
            pluginRunner = new PluginRunner();
        }
Пример #2
0
        public override bool Run()
        {
            Guard.AgainstException<RuntimeBinderException>(() =>
                this.folderToWatch = parameters.FolderToWatch,
                "The FolderToWatch parameter was not found in the parameters. Ensure that the configuration file is correct.");

            Guard.Catch<RuntimeBinderException>(() =>
            {
                if (bool.Parse(parameters.VerboseOutput))
                {
                    pluginRunner = new VerboseOutputPluginRunner(pluginRunner, notificationService);
                }
            });

            if (!Directory.Exists(folderToWatch))
            {
                notificationService.Notify(this.GetType().Name, String.Format("The directory {0} does not exist and cannot be watched", folderToWatch), NotificationType.Information);
                return false;
            }

            fileSystemWatcher = new FileSystemWatcher(folderToWatch, "*.*");
            fileSystemWatcher.IncludeSubdirectories = true;
            fileSystemWatcher.EnableRaisingEvents = true;
            fileSystemWatcher.NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName;
            fileSystemWatcher.Changed += new FileSystemEventHandler(FileSystemChanged);
            fileSystemWatcher.Created += new FileSystemEventHandler(FileSystemChanged);
            fileSystemWatcher.Renamed += FileSystemChanged;

            notificationService.Notify(String.Format("watching {0}", folderToWatch));
            return true;
        }
Пример #3
0
 public JobExecuter(IInstanceService instanceService, IPluginRunner pluginRunner, IJobRepository jobRepository,
                    IJobSessionRepository jobSessionRepository, IJobScheduleRepository jobScheduleRepository, ILogger <JobExecuter> logger,
                    IConfiguration configuration, IWorkloadAnalyzer workloadAnalyzer)
 {
     _instanceService       = instanceService;
     _pluginRunner          = pluginRunner;
     _jobRepository         = jobRepository;
     _jobSessionRepository  = jobSessionRepository;
     _jobScheduleRepository = jobScheduleRepository;
     _logger           = logger;
     _configuration    = configuration;
     _workloadAnalyzer = workloadAnalyzer;
 }
Пример #4
0
 public VerboseOutputPluginRunner(IPluginRunner pluginRunner, INotificationService notificationService)
 {
     this.pluginRunner = pluginRunner;
     this.notificationService = notificationService;
 }
Пример #5
0
 public FileSystemWatchingRunner(INotificationService notificationService, IPluginProvider pluginProvider)
 {
     this.notificationService = notificationService;
     this.pluginProvider = pluginProvider;
     this.pluginRunner = new PluginRunner();
 }