public ProcessInstance CreateNewProcessForLocalhost(string executablePath) { FileInfo executableFile = new FileInfo(executablePath); var newProcess = ProcessInstanceFactory.CreateAndStartProcess(executableFile); newProcess.Name = executableFile.Name; newProcess.User = System.Security.Principal.WindowsIdentity.GetCurrent().Name; newProcess.SessionId = new Random().Next(); newProcess.StartReadingOutput(); ProcessInstances[newProcess.SessionId] = newProcess; ProcessAdded(newProcess); return(newProcess); }
public ProcessInstance CreateNewProcess(StartProcessArguments args) { string path = ApplicationsManager.GetApplicationExecutablePath(args.ApplicationName); FileInfo executableFile = new FileInfo(path); ProcessInstance newProcess = ProcessInstanceFactory.CreateAndStartProcess(executableFile); newProcess.Name = args.ApplicationName; newProcess.User = args.UserName; newProcess.SessionId = args.SessionId; ProcessInstances[newProcess.SessionId] = newProcess; ProcessAdded(newProcess); return(newProcess); }
public ProcessManager(ProcessInstanceFactory processInstanceFactory, ApplicationsManager applicationsManager) { ProcessInstanceFactory = processInstanceFactory; ApplicationsManager = applicationsManager; }