Example #1
0
        private IAcadProcess CreateNewProcess(string executable, string workingDirectory, string arguments)
        {
            ValidateExecutablePath(executable);
            ValidateWorkingDirectory(workingDirectory);

            if (processFinder.GetProcessesByName("acad").Length > 0)
            {
                logger.Log(LogSeverity.Error,
                           "Error starting AutoCAD. An AutoCAD process is already running. " +
                           "Close any existing AutoCAD instances and try again.");

                throw new NotSupportedException("An AutoCAD process is already running.");
            }

            var process = new CreatedAcadProcess(logger, new AcadCommandRunner(), executable, processCreator, debuggerManager, pluginLocator)
            {
                Arguments        = arguments,
                WorkingDirectory = workingDirectory
            };

            return(process);
        }
        private IAcadProcess CreateNewProcess(string executable, string workingDirectory, string arguments)
        {
            ValidateExecutablePath(executable);
            ValidateWorkingDirectory(workingDirectory);

            if (processFinder.GetProcessesByName("acad").Length > 0)
            {
                logger.Log(LogSeverity.Error,
                    "Error starting AutoCAD. An AutoCAD process is already running. " +
                    "Close any existing AutoCAD instances and try again.");

                throw new NotSupportedException("An AutoCAD process is already running.");
            }

            var process = new CreatedAcadProcess(logger, new AcadCommandRunner(), executable, processCreator, debuggerManager, pluginLocator)
                              {
                                  Arguments = arguments,
                                  WorkingDirectory = workingDirectory
                              };

            return process;
        }