Beispiel #1
0
        private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            string severityName = e.AddedItems[0].ToString();

            switch (severityName)
            {
            case "Critical":
                severity = InfoBarSeverity.Critical;
                break;

            case "Warning":
                severity = InfoBarSeverity.Warning;
                break;

            case "Informational":
                severity = InfoBarSeverity.Informational;
                break;

            case "Success":
                severity = InfoBarSeverity.Success;
                break;

            case "Default":
                severity = InfoBarSeverity.Default;
                break;
            }
        }
 public void ShowStatus(string title, string message, InfoBarSeverity severity)
 {
     statusInfo.Title    = title;
     statusInfo.Message  = message;
     statusInfo.Severity = severity;
     statusInfo.IsOpen   = true;
 }
Beispiel #3
0
 internal void RaiseOpenedEvent(InfoBarSeverity severity, string displayString)
 {
     //if (IAutomationPeer7 automationPeer7 = this)
     {
         this.RaiseNotificationEvent(
             AutomationNotificationKind.Other,
             GetProcessingForSeverity(severity),
             displayString,
             "InfoBarOpenedActivityId");
     }
 }
Beispiel #4
0
        private AutomationNotificationProcessing GetProcessingForSeverity(InfoBarSeverity severity)
        {
            AutomationNotificationProcessing processing = AutomationNotificationProcessing.CurrentThenMostRecent;

            if (severity == InfoBarSeverity.Error ||
                severity == InfoBarSeverity.Warning)
            {
                processing = AutomationNotificationProcessing.ImportantAll;
            }

            return(processing);
        }
Beispiel #5
0
        internal void RaiseClosedEvent(InfoBarSeverity severity, string displayString)
        {
            //AutomationNotificationProcessing processing = AutomationNotificationProcessing.CurrentThenMostRecent;

            //if (IAutomationPeer7 automationPeer7 = this)
            {
                this.RaiseNotificationEvent(
                    AutomationNotificationKind.Other,
                    GetProcessingForSeverity(severity),
                    displayString,
                    "InfoBarClosedActivityId");
            }
        }
Beispiel #6
0
        private string GetIconSeverityLevelResourceName(InfoBarSeverity severity)
        {
            switch (severity)
            {
            case InfoBarSeverity.Success: return("InfoBarIconSeveritySuccessName");

            case InfoBarSeverity.Warning: return("InfoBarIconSeverityWarningName");

            case InfoBarSeverity.Error: return("InfoBarIconSeverityErrorName");
            }
            ;
            return("InfoBarIconSeverityInformationalName");
        }
Beispiel #7
0
 public void NotifyUser(string strMessage, InfoBarSeverity severity, bool isOpen = true)
 {
     // If called from the UI thread, then update immediately.
     // Otherwise, schedule a task on the UI thread to perform the update.
     if (DispatcherQueue.HasThreadAccess)
     {
         UpdateStatus(strMessage, severity, isOpen);
     }
     else
     {
         DispatcherQueue.TryEnqueue(() =>
         {
             UpdateStatus(strMessage, severity, isOpen);
         });
     }
 }
Beispiel #8
0
 private void UpdateStatus(string strMessage, InfoBarSeverity severity, bool isOpen)
 {
     infoBar.Message  = strMessage;
     infoBar.IsOpen   = isOpen;
     infoBar.Severity = severity;
 }
Beispiel #9
0
 public void SetLabel(string label, InfoBarSeverity severity = InfoBarSeverity.Informational)
 {
     Label    = label;
     Severity = severity;
 }