示例#1
0
        private void WriteLog(object sender, OperationCompletedEventArgs e)
        {
            var logFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "operations-history.log");

            try
            {
                File.AppendAllText(logFilePath, $"{e.CompletionTime} | Operation: {e.Operation}, IsSuccessful: {e.IsSuccessful}.\n");
            }
            catch (Exception ex)
            {
                Console.WriteLine(UNABLE_TO_OPEN_LOG_FILE + ex.Message);
            }
        }
示例#2
0
 protected virtual void OnOperationCompleted(OperationCompletedEventArgs e)
 {
     OperationCompleted?.Invoke(this, e);
 }