Making ProcessBuilder non-static
This commit is contained in:
@@ -5,12 +5,12 @@ namespace Password_Manager
|
||||
{
|
||||
public delegate void ProcessSuccess();
|
||||
public delegate void ProcessFailure(Exception e);
|
||||
static class ProcessBuilder
|
||||
sealed class ProcessBuilder
|
||||
{
|
||||
public event ProcessSuccess? ProcessFinished;
|
||||
public event ProcessFailure? ProcessFailed;
|
||||
|
||||
public static void Run(string procName, string args)
|
||||
public void Run(string procName, string args)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -25,12 +25,7 @@ namespace Password_Manager
|
||||
ClearDelegate()
|
||||
}
|
||||
|
||||
private void ClearDelegate()
|
||||
{
|
||||
//clear delegate because static
|
||||
if (ProcessFinished != null)
|
||||
{
|
||||
foreach (ProcessSuccess p in ProcessFinished)
|
||||
public string? GetOutput(string procName, string args)
|
||||
{
|
||||
ProcessFinished -= p;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user