Ejemplo n.º 1
0
 public void MessageDispatched(string message, InformationKind informationKind)
 {
     foreach (IInformationContext context in Contexts)
     {
         InformationDispatcher.Default.Dispatch(message, context, informationKind);
     }
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 /// <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;
 }
Ejemplo n.º 4
0
 /// <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)));
     }
 }
Ejemplo n.º 6
0
        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;
            }
        }
Ejemplo n.º 7
0
        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);
        }
Ejemplo n.º 8
0
        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);
        }
Ejemplo n.º 9
0
        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);
        }
Ejemplo n.º 10
0
 public void MessageDispatched(string message, InformationKind informationKind)
 {
     eventLog.WriteEntry(message, InformationKindToEventLogEntry(informationKind));
 }
Ejemplo n.º 11
0
 public void MessageDispatched(string message, InformationKind informationKind)
 {
     LastMessage         = message;
     LastInformationKind = informationKind;
 }
Ejemplo n.º 12
0
 public void Dispatch(string messsage, InformationKind informationKind = InformationKind.Info)
 {
     DefaultContext.MessageDispatched(messsage, informationKind);
 }
Ejemplo n.º 13
0
 public void Dispatch(string messsage, IInformationContext context, InformationKind informationKind = InformationKind.Info)
 {
     context.MessageDispatched(messsage, informationKind);
 }
Ejemplo n.º 14
0
 public void MessageDispatched(string message, InformationKind informationKind)
 {
     LogManager.GetCurrentClassLogger().Log(InformationKindToLogLevel(informationKind), message);
 }
Ejemplo n.º 15
0
 public PlaintextCell(int colSpan, string text, InformationKind kind)
     : base(colSpan)
 {
     this.text = text;
     this.kind = kind;
 }
Ejemplo n.º 16
0
 public void MessageDispatched(string message, InformationKind informationKind)
 {
     application.StatusBar = message;
 }
Ejemplo n.º 17
0
 public void MessageDispatched(string message, InformationKind informationKind)
 {
     MessageBox.Show(message, informationKind.ToString(), MessageBoxButtons.OK, InformationKindToMessageBoxIcon(informationKind));
 }
Ejemplo n.º 18
0
 public OutcomeInfo(string printableValue, InformationKind kind)
 {
     this.kind           = kind;
     this.printableValue = printableValue;
 }