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 OnNewEndPrint(NewEndPrintEventArgs e) { var temp = NewEndPrint; temp?.Invoke(this, e); }