/// <summary> /// Intializes a new <see cref="AcadProcessFactory"/> instance. /// </summary> /// <param name="logger">An <see cref="ILogger"/> instance.</param> /// <param name="fileSystem">An <see cref="IFileSystem"/> instance.</param> /// <param name="processFinder">A process finder.</param> /// <param name="processCreator">A process creator.</param> /// <param name="debuggerManager">An <see cref="IDebuggerManager"/> instance.</param> /// <param name="preferenceManager">The AutoCAD preference manager.</param> /// <param name="acadLocator">The AutoCAD locator.</param> /// <param name="pluginLocator">An AutoCAD plugin locator.</param> public AcadProcessFactory(ILogger logger, IFileSystem fileSystem, IProcessFinder processFinder, IProcessCreator processCreator, IDebuggerManager debuggerManager, IAcadPreferenceManager preferenceManager, IAcadLocator acadLocator, IAcadPluginLocator pluginLocator) { if (logger == null) throw new ArgumentNullException("logger"); if (fileSystem == null) throw new ArgumentNullException("fileSystem"); if (processFinder == null) throw new ArgumentNullException("processFinder"); if (processCreator == null) throw new ArgumentNullException("processCreator"); if (debuggerManager == null) throw new ArgumentNullException("debuggerManager"); if (preferenceManager == null) throw new ArgumentNullException("preferenceManager"); if (acadLocator == null) throw new ArgumentNullException("acadLocator"); if (pluginLocator == null) throw new ArgumentNullException("pluginLocator"); this.logger = logger; this.fileSystem = fileSystem; this.processFinder = processFinder; this.processCreator = processCreator; this.debuggerManager = debuggerManager; this.preferenceManager = preferenceManager; this.acadLocator = acadLocator; this.pluginLocator = pluginLocator; }
public App(TextWriter console, IDisplayDeviceFactory displayDeviceFactory, IProcessFinder processFinder, IKeyboard keyboard) { _console = console; _displayDeviceFactory = displayDeviceFactory; _processFinder = processFinder; _keyboard = keyboard; }
public LockFileBasedSemaphore(string name, TimeSpan lockTimeout, ILockIo lockIo, IProcessFinder processFinder, ILog log) { if (string.IsNullOrEmpty(name)) { throw new ArgumentNullException(nameof(name), "name cannot be null or emtpy."); } Name = name; LockTimeout = lockTimeout; LockFilePath = lockIo.GetFilePath(name); this.lockIo = lockIo; this.processFinder = processFinder; this.log = log; }
/// <summary> /// Intializes a new <see cref="AcadProcessFactory"/> instance. /// </summary> /// <param name="logger">An <see cref="ILogger"/> instance.</param> /// <param name="fileSystem">An <see cref="IFileSystem"/> instance.</param> /// <param name="processFinder">A process finder.</param> /// <param name="processCreator">A process creator.</param> /// <param name="debuggerManager">An <see cref="IDebuggerManager"/> instance.</param> /// <param name="preferenceManager">The AutoCAD preference manager.</param> /// <param name="acadLocator">The AutoCAD locator.</param> /// <param name="pluginLocator">An AutoCAD plugin locator.</param> public AcadProcessFactory(ILogger logger, IFileSystem fileSystem, IProcessFinder processFinder, IProcessCreator processCreator, IDebuggerManager debuggerManager, IAcadPreferenceManager preferenceManager, IAcadLocator acadLocator, IAcadPluginLocator pluginLocator) { if (logger == null) { throw new ArgumentNullException("logger"); } if (fileSystem == null) { throw new ArgumentNullException("fileSystem"); } if (processFinder == null) { throw new ArgumentNullException("processFinder"); } if (processCreator == null) { throw new ArgumentNullException("processCreator"); } if (debuggerManager == null) { throw new ArgumentNullException("debuggerManager"); } if (preferenceManager == null) { throw new ArgumentNullException("preferenceManager"); } if (acadLocator == null) { throw new ArgumentNullException("acadLocator"); } if (pluginLocator == null) { throw new ArgumentNullException("pluginLocator"); } this.logger = logger; this.fileSystem = fileSystem; this.processFinder = processFinder; this.processCreator = processCreator; this.debuggerManager = debuggerManager; this.preferenceManager = preferenceManager; this.acadLocator = acadLocator; this.pluginLocator = pluginLocator; }
public KillGremlin(IProcessFinder processFinder, IEventLogger logger) { _logger = logger; _gremlin = new SimpleProcessGremlin( processes => { _logger.Log(new IntervalStartingEvent("Process Kill Task", KillGremlin.Type)); try { foreach (var process in processes) { process.Kill(); _logger.Log(new ProcessKilledEvent(process, KillGremlin.Type)); } } catch (Exception exception) { _logger.Log(new ErrorEvent(exception, Type)); } _logger.Log(new IntervalEndingEvent("Process Kill Task", KillGremlin.Type)); }, processFinder); }
internal LockFileBasedSemaphore(string name, TimeSpan lockTimeout, ILockIo lockIo, IProcessFinder processFinder) : this(name, lockTimeout, lockIo, processFinder, new LogWrapper()) { }
public SimpleProcessGremlin(Action<IEnumerable<Process>> action, IProcessFinder processFinder) { _gremlinAction = action; _finder = processFinder; }
// Efficiency of implementation depends on IEnumerable<Process> returned by _finder being lazy public FilteredFinder(IProcessFinder finder, Func<IEnumerable<Process>, IEnumerable<Process>> filter) { _finder = finder; _filter = filter; }
public ProcessResolver(IProcessFinder processFinder) { this.processFinder = processFinder; }
public LimitedNumberFinder(IProcessFinder finder, int limit) : base(finder, processes => processes.Take(limit)) { }
public ProcessExecutionEngine(IProcessFinder processFinder) { _processFinder = processFinder; }