1using System.Diagnostics;
43 r().SetReturn(p.ExitCode);
60 t.SetProperty(
"Awaitable",
new BadTask(r,
"WaitForProcessExit"));
61 t.SetProperty(
"HasExited", p.HasExited);
62 t.SetProperty(
"Id", p.Id);
63 t.SetProperty(
"MachineName", p.MachineName);
64 t.SetProperty(
"Responding", p.Responding);
65 t.SetProperty(
"SessionId", p.SessionId);
66 t.SetProperty(
"HandleCount", p.HandleCount);
67 t.SetProperty(
"ProcessName", p.ProcessName);
68 t.SetProperty(
"WorkingSet64", p.WorkingSet64);
69 t.SetProperty(
"MainWindowTitle", p.MainWindowTitle);
70 t.SetProperty(
"PagedMemorySize64", p.PagedMemorySize64);
71 t.SetProperty(
"PagedSystemMemorySize64", p.PagedSystemMemorySize64);
72 t.SetProperty(
"PeakPagedMemorySize64", p.PeakPagedMemorySize64);
73 t.SetProperty(
"PeakVirtualMemorySize64", p.PeakVirtualMemorySize64);
74 t.SetProperty(
"PeakWorkingSet64", p.PeakWorkingSet64);
75 t.SetProperty(
"PrivateMemorySize64", p.PrivateMemorySize64);
76 t.SetProperty(
"VirtualMemorySize64", p.VirtualMemorySize64);
77 t.SetProperty(
"NonpagedSystemMemorySize64", p.NonpagedSystemMemorySize64);
78 t.SetFunction(
"Kill", p.Kill);
79 t.SetFunction(
"Refresh", p.Refresh);
85 [BadMethod(description:
"Runs a Process")]
86 [return: BadReturn(
"Process Table")]
90 "The name of the application to start, or the name of a document of a file type that is associated with an application and that has a default open action available to it. The default is an empty string (\"\")."
95 "A single string containing the arguments to pass to the target application specified in the FileName property. The default is an empty string (\"\"). On Windows Vista and earlier versions of the Windows operating system, the length of the arguments added to the length of the full path to the process must be less than 2080. On Windows 7 and later versions, the length must be less than 32699. Arguments are parsed and interpreted by the target application, so must align with the expectations of that application. For.NET applications as demonstrated in the Examples below, spaces are interpreted as a separator between multiple arguments. A single argument that includes spaces must be surrounded by quotation marks, but those quotation marks are not carried through to the target application. In include quotation marks in the final parsed argument, triple-escape each mark."
100 "When UseShellExecute is true, the fully qualified name of the directory that contains the process to be started. When the UseShellExecute property is false, the working directory for the process to be started. The default is an empty string (\"\")"
102 string workingDirectory,
103 [BadParameter(description:
"\ntrue if the process should be started without creating a new window to contain it; otherwise, false. The default is false.")]
106 description:
"true if the shell should be used when starting the process; false if the process should be created directly from the executable file. The default is true"
108 bool useShellExecute)
110 Process p =
new Process();
111 p.StartInfo.FileName = fileName;
112 p.StartInfo.Arguments = arguments;
113 p.StartInfo.WorkingDirectory = workingDirectory;
114 p.StartInfo.CreateNoWindow = createNoWindow;
115 p.StartInfo.UseShellExecute = useShellExecute;
IEnumerator< BadObject > WaitForProcessExit(Process p, Func< BadInteropRunnable > r)
Wrapper that creates an awaitable enumeration for a process.
override void AdditionalData(BadTable target)
BadTable Run([BadParameter(description:"The name of the application to start, or the name of a document of a file type that is associated with an application and that has a default open action available to it. The default is an empty string (\"\").")] string fileName, [BadParameter(description:"A single string containing the arguments to pass to the target application specified in the FileName property. The default is an empty string (\"\"). On Windows Vista and earlier versions of the Windows operating system, the length of the arguments added to the length of the full path to the process must be less than 2080. On Windows 7 and later versions, the length must be less than 32699. Arguments are parsed and interpreted by the target application, so must align with the expectations of that application. For.NET applications as demonstrated in the Examples below, spaces are interpreted as a separator between multiple arguments. A single argument that includes spaces must be surrounded by quotation marks, but those quotation marks are not carried through to the target application. In include quotation marks in the final parsed argument, triple-escape each mark.")] string arguments, [BadParameter(description:"When UseShellExecute is true, the fully qualified name of the directory that contains the process to be started. When the UseShellExecute property is false, the working directory for the process to be started. The default is an empty string (\"\")")] string workingDirectory, [BadParameter(description:"\ntrue if the process should be started without creating a new window to contain it; otherwise, false. The default is false.")] bool createNoWindow, [BadParameter(description:"true if the shell should be used when starting the process; false if the process should be created directly from the executable file. The default is true")] bool useShellExecute)
BadTable CreateEnvironmentTable()
Creates the "Environment" Table.
BadTable CreateProcessTable(Process p)
Creates the "Process" Table for a given Process.
Implements a Runnable that can return a value.
Implements a Task Object.
Implements an Interop API for the BS2 Language.
The Base Class for all BadScript Objects.
static readonly BadObject Null
The Null Value for the BadScript Language.
Implements a Table Structure for the BadScript Language.
Contains Common Interop APIs for the BadScript2 Runtime.
Contains task/async Extensions and Integrations for the BadScript2 Runtime.
Contains the Extension Classes for Functions.
Contains the Interop Abstractions and Implementations for the BadScript2 Language.
Contains the Runtime Objects.