Exemplo n.º 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);
                }
            }
        }
Exemplo n.º 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)
 {
 }
Exemplo n.º 3
0

        
Exemplo n.º 4
0

        
Exemplo n.º 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;
 }
Exemplo n.º 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);
            }
        }
Exemplo n.º 8
0

        
Exemplo n.º 9
0
 public StatusMessage(string what, StatusSeverity severity)
 {
     this.Severity = severity;
     this.What     = what;
     this.When     = DateTimeOffset.UtcNow;
 }
Exemplo n.º 10
0

        
Exemplo n.º 11
0

        
Exemplo n.º 12
0
 private void Log(object o, StatusSeverity severity = StatusSeverity.INFO)
 {
     Log(o.ToString(), severity);
 }
Exemplo n.º 13
0
 private void Log(string message, StatusSeverity severity = StatusSeverity.INFO)
 {
     statusService.WriteOutputWindow(message, "CFlow", severity);
 }