Пример #1
0
        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);
                }
            }
        }
Пример #2
0
 /// <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)
 {
 }
Пример #3
0

        
Пример #4
0

        
Пример #5
0
 /// <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;
 }
Пример #6
0

        
        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);
            }
        }
Пример #8
0

        
Пример #9
0
 public StatusMessage(string what, StatusSeverity severity)
 {
     this.Severity = severity;
     this.What     = what;
     this.When     = DateTimeOffset.UtcNow;
 }
Пример #10
0

        
Пример #11
0

        
Пример #12
0
 private void Log(object o, StatusSeverity severity = StatusSeverity.INFO)
 {
     Log(o.ToString(), severity);
 }
Пример #13
0
 private void Log(string message, StatusSeverity severity = StatusSeverity.INFO)
 {
     statusService.WriteOutputWindow(message, "CFlow", severity);
 }