protected override void send_sync(object sender, EventArgsMessage e) { var typ = e.Type; var txt = e.Text; vb.MsgBoxStyle stl = vb.MsgBoxStyle.Information; if (string.IsNullOrEmpty(txt)) { return; } else if ((typ & TMessage.MaskMessageBox) == 0) { return; } else if ((typ & TMessage.MaskException) > 0) { stl = vb.MsgBoxStyle.Critical; } vb.Interaction.MsgBox(txt, stl, Header); }
public void Write(object sender, EventArgsMessage e) { this.Occur(sender, e); }
protected override void send_sync(object sender, EventArgsMessage e) { if (WRT == null) { return; } TMessage typ = e.Type; string txt = e.Text, wrn = null; if (txt == null) { txt = string.Empty; } if (typ == TMessage.CommandHeader) { STP++; WRT.WriteLine(" ---------------- "); } if (string.IsNullOrEmpty(txt)) { return; } else if (typ == TMessage.None) { return; } else if ((typ == TMessage.InlineText)) { return; } else if ((typ == TMessage.UserInput)) { return; } #if !DEBUG else if (typ == TMessage.QueryData) { return; } #endif else if ((typ & TMessage.MaskMessageBox) > 0) { return; } else if (typ == TMessage.Warning) { wrn = STR_PFXWARN + ' '; } else if (typ == TMessage.ExceptionWorkflow) { wrn = STR_PFXEXC0 + ' '; } else if (typ == TMessage.ExceptionCritical) { wrn = STR_PFXEXC1 + ' '; } WRT.WriteLine(STR_FMTMESG, DateTime.Now, STP, txt, wrn); WRT.Flush(); }
protected override void send_async(object sender, EventArgsMessage e) { var trd = new Task(this.send, e); trd.Start(); }
protected override void send_sync(object sender, EventArgsMessage e) { this.send(e); }
protected override void send_sync(object sender, EventArgsMessage e) { TMessage typ = e.Type; string txt = e.Text; if (txt == null) { txt = string.Empty; } // this processes some system-messages #if !DEBUG if (typ == TMessage.QueryData) { return; } #endif if (typ == TMessage.Progress) { if (STR_PROGRSS != txt) { if (!string.IsNullOrEmpty(STR_PROGRSS)) { Console.WriteLine(); } Console.Write(STR_FMTCONS + " ", DateTime.Now, STP, STR_PROGRSS = txt); } Console.Write('.'); return; } else if (STR_PROGRSS != null) { STR_PROGRSS = null; Console.WriteLine(); } if (string.IsNullOrEmpty(txt)) { return; } else if (typ == TMessage.None) { return; } else if ((typ & TMessage.MaskMessageBox) > 0) { return; } else if (typ == TMessage.Warning) { Console.ForegroundColor = ConsoleColor.Yellow; } else if ((typ & TMessage.MaskException) > 0) { Console.ForegroundColor = ConsoleColor.Red; } else if (typ == TMessage.CommandResult) { Console.ForegroundColor = ConsoleColor.White; } else if (typ == TMessage.UserInput) { Console.ForegroundColor = ConsoleColor.White; } else if (typ == TMessage.QueryData) { Console.ForegroundColor = ConsoleColor.DarkGray; } else if (typ == TMessage.CommandHeader) { Console.WriteLine(" -------------- "); STP++; } if (typ == TMessage.UserInput) { Console.Write(txt); Console.Write(" >> "); } else if (typ == TMessage.InlineText) { Console.Write(txt); } else if (typ == TMessage.CommandReport) { Console.WriteLine(STR_FMTCONS, DateTime.Now, STP++, "Отчёт сформирован"); } else { Console.WriteLine(STR_FMTCONS, DateTime.Now, STP, txt); } Console.ForegroundColor = ConsoleColor.Gray; }
protected virtual void send_async(object sender, EventArgsMessage e) { throw new NotImplementedException("Asychronous messaging is not supported"); }