UtilProcessForEachProcessByNameGetT Method
Performs an action on all the Process objects found of running processes with the specified name.
Namespace: DevCase.Core.Diagnostics.ProcessesAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static IEnumerable<T> ForEachProcessByNameGet<T>(
string processName,
Func<Process, T> predicate,
bool throwOnProcessNotFound = false
)
Public Shared Function ForEachProcessByNameGet(Of T) (
processName As String,
predicate As Func(Of Process, T),
Optional throwOnProcessNotFound As Boolean = false
) As IEnumerable(Of T)
Dim processName As String
Dim predicate As Func(Of Process, T)
Dim throwOnProcessNotFound As Boolean
Dim returnValue As IEnumerable(Of T)
returnValue = UtilProcess.ForEachProcessByNameGet(processName,
predicate, throwOnProcessNotFound)
public:
generic<typename T>
static IEnumerable<T>^ ForEachProcessByNameGet(
String^ processName,
Func<Process^, T>^ predicate,
bool throwOnProcessNotFound = false
)
static member ForEachProcessByNameGet :
processName : string *
predicate : Func<Process, 'T> *
?throwOnProcessNotFound : bool
(* Defaults:
let _throwOnProcessNotFound = defaultArg throwOnProcessNotFound false
*)
-> IEnumerable<'T>
No code example is currently available or this language may not be supported.
- processName String
-
The process name.
- predicate FuncProcess, T
-
A transform function to apply to each process found.
- throwOnProcessNotFound Boolean (Optional)
-
If , throws an ArgumentException exception if any process was found with the specified name.
- T
-
The Type of the value to return.
IEnumerableT
If successful, the returning value is an
IEnumerableT; otherwise,
if
throwOnProcessNotFound is
and
any process was found with the specified name.
This is a code example.
No code example is currently available or this language may not be supported.
Dim pids As IEnumerable(Of Integer) =
ForEachProcessByNameGet("notepad.exe", Function(p As Process) p.Id, throwOnProcessNotFound:=True)
MessageBox.Show(String.Join(", ", pids))
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
ArgumentException
|
Any process found with the specified name.;processName
|