public static void StopProcess(PROCESS process) { lock (Lockers[(int)process]) { GenericProcess currentProcess = Processes[(int)process]; if (currentProcess != null) { currentProcess.Stop(); } Processes[(int)process] = null; } }
public static bool WriteLineToStandardInput(PROCESS process, string line) { try { GenericProcess currentProcess = Processes[(int)process]; if (currentProcess != null && !currentProcess.hasExited) { return(currentProcess.SendLine(line)); } } catch (Exception) { } return(false); }
public void Create(SubProcess subProcess, string link) { var SubId = GetSubId(link).First(); var process = new PROCESS { Owner = subProcess.UserName, Created_Date = DateTime.Now, Sub_Id = SubId, Title = subProcess.Title }; try { model.PROCESS.Add(process); Save(); } catch (Exception e) { Console.WriteLine(e.Message); } }
public static void StartProcess(PROCESS process) { lock (Lockers[(int)process]) { GenericProcess currentProcess = Processes[(int)process]; if (currentProcess != null && !currentProcess.hasExited) { return; } if (process == PROCESS.LOCKING_DEVICE && Program.IPAddressServer != null) { Processes[(int)process] = new LockerProcess(Program.IPAddressServer.ToString()); } else if (process == PROCESS.VIDEO_STREAMING && Program.IPAddressServer != null) { //Processes[(int)process] = new VideoStreamerProcess(Program.IPAddressServer.ToString()); } } }
/// <summary> /// parse a <code><process-archive .../></code> element and add it to the list of parsed elements /// </summary> protected internal virtual void parseProcessArchive(Element element, IList <ProcessArchiveXml> parsedProcessArchives) { ProcessArchiveXmlImpl processArchive = new ProcessArchiveXmlImpl(); processArchive.Name = element.attribute(NAME); processArchive.TenantId = element.attribute(TENANT_ID); IList <string> processResourceNames = new List <string>(); IDictionary <string, string> properties = new Dictionary <string, string>(); foreach (Element childElement in element.elements()) { if (PROCESS_ENGINE.Equals(childElement.TagName)) { processArchive.ProcessEngineName = childElement.Text; } else if (PROCESS.Equals(childElement.TagName) || RESOURCE.Equals(childElement.TagName)) { processResourceNames.Add(childElement.Text); } else if (PROPERTIES.Equals(childElement.TagName)) { parseProperties(childElement, properties); } } // set properties processArchive.Properties = properties; // add collected resource names. processArchive.ProcessResourceNames = processResourceNames; // add process archive to list of parsed archives. parsedProcessArchives.Add(processArchive); }
public static extern IntPtr OpenProcess(PROCESS dwDesiredAccess, int bInheritHandle, IntPtr dwProcessId);
public static extern IntPtr OpenProcess(PROCESS dwDesiredAccess, Int32 bInheritHandle, IntPtr dwProcessId);
public static extern System.IntPtr OpenProcess( PROCESS access, [Interop::MarshalAs(Interop::UnmanagedType.Bool)] bool inherit, int procId );