public void Print(FileStream fileStream, Printer printer) { Logger.WriteLog($"User print file {fileStream.Name} through {printer.ToString()}"); var eventStart = new NewStartPrintEventArgs(printer.ToString(), DateTime.Now); this.OnNewStartPrint(eventStart); printer.Print(fileStream); Thread.Sleep(3000); var eventEnd = new NewEndPrintEventArgs(printer.ToString(), DateTime.Now); this.OnNewEndPrint(eventEnd); }
protected virtual void OnNewStartPrint(NewStartPrintEventArgs e) { var temp = NewStartPrint; temp?.Invoke(this, e); }