protected override void ParseToEvent(Reply reply) { base.ParseToEvent(reply); int index = 0; string[] split = EventLine.Split(' '); Severity = Utility.ParseEnum<StatusSeverity>(split[index]); index++; Action = split[index]; index++; Arguments = new Dictionary<string, string>(); for (int i = index; i < split.Length; i++) { if (split[i].Contains("=")) { string key = split[i].Split('=')[0]; string value = split[i].Split('=')[1].Replace("\"", ""); Arguments.Add(key, value); } } }
/// <summary>Creates a new notification with the specified severity and text.</summary> ///// <param name="notifier"><see cref="INotifier"/> which published the notification.</param> /// <param name="severity">Severity of the notification.</param> /// <param name="text">Text for the notification.</param> /// <param name="contextActions">The available actions which are relevant to the notification.</param> public Notification( //INotifier notifier, StatusSeverity severity, string text, params ContextAction[] contextActions) : this(severity, text, DateTime.Now, contextActions) { }
/// <summary>Creates a new notification with the specified severity, text, and time.</summary> ///// <param name="notifier"><see cref="INotifier"/> which published the notification.</param> /// <param name="severity">Severity of the notification.</param> /// <param name="text">Text for the notification.</param> /// <param name="timeOf">The time of the notification.</param> /// <param name="contextActions">The available actions which are relevant to the notification.</param> public Notification( //INotifier notifier, StatusSeverity severity, string text, DateTime timeOf, params ContextAction[] contextActions) { //Notifier = notifier; Severity = severity; Text = text; TimeOf = timeOf; ContextActions = contextActions; }
private void LogStatusMessage(string message, StatusSeverity severity, bool say = false) { var ignored = Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { while (StatusLog.Count > 100) { StatusLog.RemoveAt(StatusLog.Count - 1); } StatusLog.Insert(0, new StatusMessage(message, severity)); }); if (say) { vpGenerated.Say(message); } }
public StatusMessage(string what, StatusSeverity severity) { this.Severity = severity; this.What = what; this.When = DateTimeOffset.UtcNow; }
private void Log(object o, StatusSeverity severity = StatusSeverity.INFO) { Log(o.ToString(), severity); }
private void Log(string message, StatusSeverity severity = StatusSeverity.INFO) { statusService.WriteOutputWindow(message, "CFlow", severity); }