Sic.Framework/MECF.Framework.UI.Client/CenterViews/Alarms/Alarm/AlarmView.xaml.cs

73 lines
2.1 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Text;
using System.Windows.Controls;
using Aitex.Core.UI.View.Common;
namespace MECF.Framework.UI.Client.CenterViews.Alarms.Alarm
{
/// <summary>
/// AlarmView.xaml 的交互逻辑
/// </summary>
public partial class AlarmView : UserControl
{
public AlarmView()
{
InitializeComponent();
}
private void listView1_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.AddedItems.Count == 1 && e.AddedItems[0] is AlarmItem item)
{
var sb = new StringBuilder();
sb.Append("Event Type");
sb.Append(item.LevelString);
sb.AppendLine();
sb.AppendLine();
sb.Append("Event Source");
sb.Append(item.Source);
sb.AppendLine();
sb.AppendLine();
sb.Append("Event Name");
sb.Append(item.EventEnum);
sb.AppendLine();
sb.AppendLine();
sb.Append("Time");
sb.Append(item.OccuringTime);
sb.AppendLine();
sb.AppendLine();
sb.Append("Description");
sb.Append(item.Description);
sb.AppendLine();
sb.AppendLine();
sb.Append("Possible Solution");
sb.Append(item.Solution);
sb.AppendLine();
sb.AppendLine();
//sb.Append("Acknowledged");
//sb.Append(item.IsAcknowledged ? "Yes" : "No");
//sb.AppendLine();
//sb.AppendLine();
//sb.Append("Acknowledged Time");
//sb.Append(item.AcknowledgeTime.ToString("yyyy/MM/dd HH:mm:ss"));
//sb.AppendLine();
//sb.AppendLine();
AnalysisText.Text = sb.ToString();
}
else
{
AnalysisText.Text = string.Empty;
}
}
}
}