Exemple #1
0
        public void StartProcess()
        {
            var data = new ProcessEventArgs();

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

                // some code here..

                data.IsSuccessful   = true;
                data.CompletionTime = DateTime.Now;
                OnProcessCompleted(data);
            }
            catch (Exception ex)
            {
                data.IsSuccessful   = false;
                data.CompletionTime = DateTime.Now;
                OnProcessCompleted(data);
            }
        }
Exemple #2
0
 protected virtual void OnProcessCompleted(ProcessEventArgs e)
 {
     ProcessCompleted?.Invoke(this, e);
 }