public void StartProcess()
        {
            OnProcessStarted(EventArgs.Empty);
            var data = new ProcessEventArgs();

            try
            {
                Console.WriteLine("Process Started!");

                // some process code here..
                data.IsSuccessful   = true;
                data.CompletionTime = DateTime.Now;
                OnProcessCompleted(data);
            }
            catch (Exception)
            {
                data.IsSuccessful   = false;
                data.CompletionTime = DateTime.Now;
                OnProcessCompleted(data);
            }
        }
 // event handler
 public static void ProcessBeganNotify(object sender, ProcessEventArgs e)
 {
     Console.WriteLine("\"Update front-end with is successfull: " + e.IsSuccessful + " - message. \" ");
 }
 // event handler
 public static void Bl_ProcessCompleted(object sender, ProcessEventArgs e)
 {
     Console.WriteLine("Process " + (e.IsSuccessful ? "Completed Successfully" : "failed"));
     Console.WriteLine("Completion Time: " + e.CompletionTime.ToLongDateString());
 }
 //Denne metode "raises" eventet
 protected virtual void OnProcessCompleted(ProcessEventArgs e)
 {
     //invokes the delegate
     // This will call all the event handler methods registered with the ProcessCompleted event.
     ProcessCompleted?.Invoke(this, e);
 }