public void MessageDispatched(string message, InformationKind informationKind) { foreach (IInformationContext context in Contexts) { InformationDispatcher.Default.Dispatch(message, context, informationKind); } }
public MonitorCell(int colSpan, bool showTime, TimeSpan time, string cellText, InformationKind kind) : base(colSpan) { this.showTime = showTime; this.time = time; this.text = cellText; this.kind = kind; }
/// <summary> /// Initialize information /// </summary> /// <param name="kind">InformationKind.Notify or InformationKind.Warning</param> /// <param name="id">identification string, this used for remove duplication.</param> /// <param name="header">one-liner description</param> /// <param name="detail">detail description</param> public Information(InformationKind kind, string id, string header, string detail) { if (kind == InformationKind.Error) throw new ArgumentException("you should use another overload."); this.Id = id; this.Kind = kind; this.Header = header; this.Detail = detail; }
/// <summary> /// Initialize information /// </summary> /// <param name="kind">InformationKind.Error</param> /// <param name="id">identification string, this used for remove duplication.</param> /// <param name="header">one-liner description</param> /// <param name="detail">detail description</param> /// <param name="actionDesc">description of the action</param> /// <param name="act">fix action</param> public Information(InformationKind kind, string id, string header, string detail, string actionDesc, Action act) { if (kind != InformationKind.Error) throw new ArgumentException("you should use another overload."); this.Id = id; this.Kind = kind; this.Header = header; this.Detail = detail; this.ActionDescription = actionDesc; this.UserAction = act; }
static string FormatText(string text, InformationKind textKind, string positiveCssClass, string negativeCssClass) { if (textKind == InformationKind.Neutral) { return(text); } else { return(string.Format("<span class='{0}'>{1}</span>", textKind == InformationKind.Positive ? positiveCssClass : negativeCssClass, HttpUtility.HtmlEncode(text))); } }
public void MessageDispatched(string message, InformationKind informationKind) { switch (informationKind) { case InformationKind.Info: //Callback?.SendDebugMessage(message); break; case InformationKind.Warning: break; case InformationKind.Error: Callback?.SendErrorMessage(message); break; } }
private EventLogEntryType InformationKindToEventLogEntry(InformationKind information) { switch (information) { case InformationKind.Info: return(EventLogEntryType.Information); case InformationKind.Warning: return(EventLogEntryType.Warning); case InformationKind.Error: return(EventLogEntryType.Error); } return(EventLogEntryType.Information); }
private MessageBoxIcon InformationKindToMessageBoxIcon(InformationKind informationKind) { switch (informationKind) { case InformationKind.Info: return(MessageBoxIcon.Information); case InformationKind.Warning: return(MessageBoxIcon.Warning); case InformationKind.Error: return(MessageBoxIcon.Error); case InformationKind.Debug: return(MessageBoxIcon.Information); } return(MessageBoxIcon.Information); }
private LogLevel InformationKindToLogLevel(InformationKind informationKind) { switch (informationKind) { case InformationKind.Info: return(LogLevel.Info); case InformationKind.Warning: return(LogLevel.Warn); case InformationKind.Error: return(LogLevel.Error); case InformationKind.Debug: return(LogLevel.Debug); } return(LogLevel.Info); }
public void MessageDispatched(string message, InformationKind informationKind) { eventLog.WriteEntry(message, InformationKindToEventLogEntry(informationKind)); }
public void MessageDispatched(string message, InformationKind informationKind) { LastMessage = message; LastInformationKind = informationKind; }
public void Dispatch(string messsage, InformationKind informationKind = InformationKind.Info) { DefaultContext.MessageDispatched(messsage, informationKind); }
public void Dispatch(string messsage, IInformationContext context, InformationKind informationKind = InformationKind.Info) { context.MessageDispatched(messsage, informationKind); }
public void MessageDispatched(string message, InformationKind informationKind) { LogManager.GetCurrentClassLogger().Log(InformationKindToLogLevel(informationKind), message); }
public PlaintextCell(int colSpan, string text, InformationKind kind) : base(colSpan) { this.text = text; this.kind = kind; }
public void MessageDispatched(string message, InformationKind informationKind) { application.StatusBar = message; }
public void MessageDispatched(string message, InformationKind informationKind) { MessageBox.Show(message, informationKind.ToString(), MessageBoxButtons.OK, InformationKindToMessageBoxIcon(informationKind)); }
public OutcomeInfo(string printableValue, InformationKind kind) { this.kind = kind; this.printableValue = printableValue; }