コード例 #1
0
        /// <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;
        }
コード例 #2
0
ファイル: App.cs プロジェクト: SaxxonPike/AppRes
 public App(TextWriter console, IDisplayDeviceFactory displayDeviceFactory, IProcessFinder processFinder,
            IKeyboard keyboard)
 {
     _console = console;
     _displayDeviceFactory = displayDeviceFactory;
     _processFinder        = processFinder;
     _keyboard             = keyboard;
 }
コード例 #3
0
        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;
        }
コード例 #4
0
        /// <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;
        }
コード例 #5
0
 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);
 }
コード例 #6
0
 internal LockFileBasedSemaphore(string name, TimeSpan lockTimeout, ILockIo lockIo, IProcessFinder processFinder)
     : this(name, lockTimeout, lockIo, processFinder, new LogWrapper())
 {
 }
コード例 #7
0
 public SimpleProcessGremlin(Action<IEnumerable<Process>> action, IProcessFinder processFinder)
 {
     _gremlinAction = action;
     _finder = processFinder;
 }
コード例 #8
0
 // 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;
 }
コード例 #9
0
 public ProcessResolver(IProcessFinder processFinder)
 {
     this.processFinder = processFinder;
 }
コード例 #10
0
 public LimitedNumberFinder(IProcessFinder finder, int limit)
     : base(finder, processes => processes.Take(limit))
 {
 }
コード例 #11
0
 public ProcessResolver(IProcessFinder processFinder)
 {
     this.processFinder = processFinder;
 }
コード例 #12
0
 public ProcessExecutionEngine(IProcessFinder processFinder)
 {
     _processFinder = processFinder;
 }