示例#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);
            }
        }
示例#2
0
 protected virtual void OnProcessCompleted(ProcessEventArgs e)
 {
     ProcessCompleted?.Invoke(this, e);
 }