コード例 #1
0
        protected virtual void OnRaiseCustomEvent(FileWriteComplete e, string fileName)
        {
            EventHandler <FileWriteComplete> raiseEvent = RaiseCustomEvent;

            if (raiseEvent == null)
            {
                return;
            }

            e.Message += $" at {DateTime.Now}";

            File.AppendAllText($"../../../../{fileName}.txt",
                               $"Wrote PICKLE RICK to {fileName}: {e.Message}\n");

            Console.WriteLine($"Wrote PICKLE RICK to {fileName}: {e.Message}");
            raiseEvent(this, e);
        }
コード例 #2
0
ファイル: DisplayService.cs プロジェクト: raaedk/FileWriter
 private void HandleCustomEvent(object sender, FileWriteComplete e)
 {
     Console.WriteLine($"User ID:{_id} File Write Completed");
 }