refactor: 将Framework库和RT、UI放在同一个解决方案中。
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
||||
<CheckBox x:Class="MECF.Framework.UI.Client.CenterViews.Configs.SignalTowerConfig.RadioCheckBox"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:MECF.Framework.UI.Client.CenterViews.Configs.SignalTowerConfig"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<CheckBox.Style>
|
||||
<Style TargetType="{x:Type local:RadioCheckBox}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type local:RadioCheckBox}">
|
||||
<Grid>
|
||||
<RadioButton
|
||||
IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent},
|
||||
Path=IsChecked, Mode=TwoWay}"
|
||||
IsHitTestVisible="False" />
|
||||
<CheckBox
|
||||
IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent},
|
||||
Path=IsChecked, Mode=TwoWay}" Opacity="0"/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</CheckBox.Style>
|
||||
</CheckBox>
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace MECF.Framework.UI.Client.CenterViews.Configs.SignalTowerConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// RadioCheckBox.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class RadioCheckBox : CheckBox
|
||||
{
|
||||
public RadioCheckBox()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
+130
@@ -0,0 +1,130 @@
|
||||
<UserControl x:Class="MECF.Framework.UI.Client.CenterViews.Configs.SignalTowerConfig.SignalTowerConfigView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
|
||||
xmlns:micro="clr-namespace:Caliburn.Micro"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="1024" d:DesignWidth="1900">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="150"/>
|
||||
<ColumnDefinition Width="100"/>
|
||||
<ColumnDefinition Width="100"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Content="Save" Grid.Column="1" Width="90" Height="30" Margin="0" Padding="0" >
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="SaveSelection">
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
|
||||
<Button Content="Cancel" Grid.Column="2" Width="90" Height="30" Margin="0" Padding="0" >
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="CancelSelection">
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="1">
|
||||
<DataGrid HorizontalAlignment="Left" CanUserAddRows="False" AutoGenerateColumns="False" RowHeaderWidth="0"
|
||||
VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling"
|
||||
ItemsSource="{Binding SignalTowerData}" Margin="0,5,0,0" >
|
||||
|
||||
<DataGrid.Columns>
|
||||
<DataGridTemplateColumn Header="Condition Name" Width="300">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Name}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" >
|
||||
</TextBlock>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<DataGridTemplateColumn Header="Red" Width="140">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
|
||||
<Border HorizontalAlignment="Stretch" Background="OrangeRed">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<CheckBox VerticalContentAlignment="Center" VerticalAlignment="Center" Content="ON" IsChecked="{Binding Path=IsRed, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="50" Height="25" ></CheckBox>
|
||||
<CheckBox Padding="10,0,0,0" VerticalContentAlignment="Center" VerticalAlignment="Center" Content="Blinking" IsChecked="{Binding Path=IsRedBlinking, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="80" Height="25" ></CheckBox>
|
||||
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<DataGridTemplateColumn Header="Yellow" Width="140">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Border HorizontalAlignment="Stretch" Background="LightGoldenrodYellow">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<CheckBox VerticalContentAlignment="Center" VerticalAlignment="Center" Content="ON" IsChecked="{Binding Path=IsYellow, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="50" Height="25" ></CheckBox>
|
||||
<CheckBox Padding="10,0,0,0" VerticalContentAlignment="Center" VerticalAlignment="Center" Content="Blinking" IsChecked="{Binding Path=IsYellowBlinking, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="80" Height="25" ></CheckBox>
|
||||
|
||||
</StackPanel> </Border>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<DataGridTemplateColumn Header="Green" Width="140">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Border HorizontalAlignment="Stretch" Background="LightGreen">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<CheckBox VerticalContentAlignment="Center" VerticalAlignment="Center" Content="ON" IsChecked="{Binding Path=IsGreen, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="50" Height="25" ></CheckBox>
|
||||
<CheckBox Padding="10,0,0,0" VerticalContentAlignment="Center" VerticalAlignment="Center" Content="Blinking" IsChecked="{Binding Path=IsGreenBlinking, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="80" Height="25" ></CheckBox>
|
||||
|
||||
</StackPanel> </Border>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
|
||||
<DataGridTemplateColumn Header="Blue" Width="140">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Border HorizontalAlignment="Stretch" Background="LightBlue">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<CheckBox VerticalContentAlignment="Center" VerticalAlignment="Center" Content="ON" IsChecked="{Binding Path=IsBlue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="50" Height="25" ></CheckBox>
|
||||
<CheckBox Padding="10,0,0,0" VerticalContentAlignment="Center" VerticalAlignment="Center" Content="Blinking" IsChecked="{Binding Path=IsBlueBlinking, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="80" Height="25" ></CheckBox>
|
||||
|
||||
</StackPanel> </Border>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<DataGridTemplateColumn Header="Buzzer" Width="140">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Border HorizontalAlignment="Stretch" Background="White">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<CheckBox VerticalContentAlignment="Center" VerticalAlignment="Center" Content="ON" IsChecked="{Binding Path=IsBuzzer, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="50" Height="25" ></CheckBox>
|
||||
<CheckBox Padding="10,0,0,0" VerticalContentAlignment="Center" VerticalAlignment="Center" Content="Blinking" IsChecked="{Binding Path=IsBuzzerBlinking, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="80" Height="25" ></CheckBox>
|
||||
|
||||
</StackPanel> </Border>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace MECF.Framework.UI.Client.CenterViews.Configs.SignalTowerConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// SignalTowerConfigView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class SignalTowerConfigView : UserControl
|
||||
{
|
||||
public SignalTowerConfigView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+320
@@ -0,0 +1,320 @@
|
||||
using Aitex.Core.RT.Log;
|
||||
using MECF.Framework.Common.CommonData;
|
||||
using MECF.Framework.Common.DataCenter;
|
||||
using MECF.Framework.UI.Client.ClientBase;
|
||||
using SciChart.Core.Extensions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Xml;
|
||||
|
||||
namespace MECF.Framework.UI.Client.CenterViews.Configs.SignalTowerConfig
|
||||
{
|
||||
public class SignalTowerConfigViewModel : UiViewModelBase, ISupportMultipleSystem
|
||||
{
|
||||
public class SignalTowerItem : NotifiableItem
|
||||
{
|
||||
private string _name;
|
||||
public string Name
|
||||
{
|
||||
get { return _name; }
|
||||
set { _name = value; InvokePropertyChanged(nameof(Name)); }
|
||||
}
|
||||
|
||||
private bool _isRed;
|
||||
public bool IsRed
|
||||
{
|
||||
get { return _isRed; }
|
||||
set
|
||||
{
|
||||
_isRed = value;
|
||||
if (value) IsRedBlinking = false; InvokePropertyChanged(nameof(IsRed));
|
||||
}
|
||||
}
|
||||
|
||||
private bool _isRedBlinking;
|
||||
public bool IsRedBlinking
|
||||
{
|
||||
get { return _isRedBlinking; }
|
||||
set
|
||||
{
|
||||
_isRedBlinking = value;
|
||||
if (value) IsRed = false; InvokePropertyChanged(nameof(IsRedBlinking));
|
||||
}
|
||||
}
|
||||
|
||||
private bool _isGreen;
|
||||
public bool IsGreen
|
||||
{
|
||||
get { return _isGreen; }
|
||||
set
|
||||
{
|
||||
_isGreen = value;
|
||||
if (value) IsGreenBlinking = false; InvokePropertyChanged(nameof(IsGreen));
|
||||
}
|
||||
}
|
||||
|
||||
private bool _isGreenBlinking;
|
||||
public bool IsGreenBlinking
|
||||
{
|
||||
get { return _isGreenBlinking; }
|
||||
set
|
||||
{
|
||||
_isGreenBlinking = value;
|
||||
if (value) IsGreen = false; InvokePropertyChanged(nameof(IsGreenBlinking));
|
||||
}
|
||||
}
|
||||
|
||||
private bool _isBlue;
|
||||
public bool IsBlue
|
||||
{
|
||||
get { return _isBlue; }
|
||||
set
|
||||
{
|
||||
_isBlue = value;
|
||||
if (value) IsBlueBlinking = false; InvokePropertyChanged(nameof(IsBlue));
|
||||
}
|
||||
}
|
||||
private bool _isBlueBlinking;
|
||||
public bool IsBlueBlinking
|
||||
{
|
||||
get { return _isBlueBlinking; }
|
||||
set
|
||||
{
|
||||
_isBlueBlinking = value;
|
||||
if (value) IsBlue = false; InvokePropertyChanged(nameof(IsBlueBlinking));
|
||||
}
|
||||
}
|
||||
|
||||
private bool _isYellow;
|
||||
public bool IsYellow
|
||||
{
|
||||
get { return _isYellow; }
|
||||
set
|
||||
{
|
||||
_isYellow = value;
|
||||
if (value) IsYellowBlinking = false; InvokePropertyChanged(nameof(IsYellow));
|
||||
}
|
||||
}
|
||||
private bool _isYellowBlinking;
|
||||
public bool IsYellowBlinking
|
||||
{
|
||||
get { return _isYellowBlinking; }
|
||||
set
|
||||
{
|
||||
_isYellowBlinking = value;
|
||||
if (value) IsYellow = false; InvokePropertyChanged(nameof(IsYellowBlinking));
|
||||
}
|
||||
}
|
||||
|
||||
private bool _isBuzzer;
|
||||
public bool IsBuzzer
|
||||
{
|
||||
get { return _isBuzzer; }
|
||||
set
|
||||
{
|
||||
_isBuzzer = value;
|
||||
if (value) IsBuzzerBlinking = false; InvokePropertyChanged(nameof(IsBuzzer));
|
||||
}
|
||||
}
|
||||
|
||||
private bool _isBuzzerBlinking;
|
||||
public bool IsBuzzerBlinking
|
||||
{
|
||||
get { return _isBuzzerBlinking; }
|
||||
set
|
||||
{
|
||||
_isBuzzerBlinking = value;
|
||||
if (value) IsBuzzer = false; InvokePropertyChanged(nameof(IsBuzzerBlinking));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region Properties
|
||||
|
||||
public ObservableCollection<SignalTowerItem> SignalTowerData { get; set; }
|
||||
|
||||
private string _contentDataGroup;
|
||||
|
||||
private XmlDocument _xmlSignalTower;
|
||||
|
||||
private List<string> _lstItems = new List<string>();
|
||||
|
||||
#endregion
|
||||
|
||||
#region Functions
|
||||
public SignalTowerConfigViewModel()
|
||||
{
|
||||
this.DisplayName = "SignalTower Config ";
|
||||
|
||||
SignalTowerData = new ObservableCollection<SignalTowerItem>();
|
||||
|
||||
}
|
||||
|
||||
protected override void OnInitialize()
|
||||
{
|
||||
base.OnInitialize();
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected override void OnActivate()
|
||||
{
|
||||
base.OnActivate();
|
||||
|
||||
UpdateData();
|
||||
}
|
||||
|
||||
private void UpdateData()
|
||||
{
|
||||
|
||||
|
||||
if (_xmlSignalTower == null)
|
||||
{
|
||||
string contentSignal = QueryDataClient.Instance.Service.GetTypedConfigContent("SignalTower", "");
|
||||
|
||||
try
|
||||
{
|
||||
_xmlSignalTower = new XmlDocument();
|
||||
_xmlSignalTower.LoadXml(contentSignal);
|
||||
|
||||
var items = _xmlSignalTower.SelectNodes($"STEvents/STEvent");
|
||||
|
||||
foreach (var item in items)
|
||||
{
|
||||
XmlElement element = item as XmlElement;
|
||||
|
||||
SignalTowerItem stItem = new SignalTowerItem();
|
||||
|
||||
stItem.Name = element.GetAttribute("name");
|
||||
stItem.IsRed = string.Compare(element.GetAttribute("Red"), "on", StringComparison.CurrentCultureIgnoreCase) == 0;
|
||||
stItem.IsRedBlinking = string.Compare(element.GetAttribute("Red"), "blinking", StringComparison.CurrentCultureIgnoreCase) == 0;
|
||||
|
||||
stItem.IsYellow = string.Compare(element.GetAttribute("Yellow"), "on", StringComparison.CurrentCultureIgnoreCase) == 0;
|
||||
stItem.IsYellowBlinking = string.Compare(element.GetAttribute("Yellow"), "blinking", StringComparison.CurrentCultureIgnoreCase) == 0;
|
||||
|
||||
stItem.IsGreen = string.Compare(element.GetAttribute("Green"), "on", StringComparison.CurrentCultureIgnoreCase) == 0;
|
||||
stItem.IsGreenBlinking = string.Compare(element.GetAttribute("Green"), "blinking", StringComparison.CurrentCultureIgnoreCase) == 0;
|
||||
|
||||
stItem.IsBlue = string.Compare(element.GetAttribute("Blue"), "on", StringComparison.CurrentCultureIgnoreCase) == 0;
|
||||
stItem.IsBlueBlinking = string.Compare(element.GetAttribute("Blue"), "blinking", StringComparison.CurrentCultureIgnoreCase) == 0;
|
||||
|
||||
stItem.IsBuzzer = string.Compare(element.GetAttribute("Buzzer"), "on", StringComparison.CurrentCultureIgnoreCase) == 0;
|
||||
stItem.IsBuzzerBlinking = string.Compare(element.GetAttribute("Buzzer"), "blinking", StringComparison.CurrentCultureIgnoreCase) == 0;
|
||||
|
||||
SignalTowerData.Add(stItem);
|
||||
|
||||
stItem.InvokePropertyChanged();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LOG.Write(ex);
|
||||
}
|
||||
}
|
||||
|
||||
string content = QueryDataClient.Instance.Service.GetTypedConfigContent("DataGroup", "");
|
||||
|
||||
if (_contentDataGroup == content)
|
||||
return;
|
||||
try
|
||||
{
|
||||
XmlDocument xmlContent = new XmlDocument();
|
||||
xmlContent.LoadXml(content);
|
||||
|
||||
_contentDataGroup = content;
|
||||
|
||||
var groups = xmlContent.SelectNodes($"DataGroupConfig/DataGroup[@name='SignalTower']/DataItem");
|
||||
|
||||
List<string> names = new List<string>();
|
||||
foreach (var item in groups)
|
||||
{
|
||||
XmlElement element = item as XmlElement;
|
||||
|
||||
string name = element.GetAttribute("name");
|
||||
|
||||
names.Add(name);
|
||||
|
||||
if (SignalTowerData.FirstOrDefault(x => x.Name == name) == null)
|
||||
{
|
||||
SignalTowerData.Add(new SignalTowerItem() { Name = name, });
|
||||
}
|
||||
}
|
||||
|
||||
SignalTowerData.RemoveWhere(x => !names.Contains(x.Name));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LOG.Write(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public void SaveSelection()
|
||||
{
|
||||
var nodeGroup = _xmlSignalTower.SelectSingleNode($"STEvents");
|
||||
|
||||
var nodeItem = _xmlSignalTower.SelectNodes($"STEvents/STEvent");
|
||||
foreach (var nodeGroupChildNode in nodeItem)
|
||||
{
|
||||
var node = nodeGroupChildNode as XmlElement;
|
||||
nodeGroup.RemoveChild(node);
|
||||
}
|
||||
|
||||
foreach (var item in SignalTowerData)
|
||||
{
|
||||
var node = _xmlSignalTower.CreateElement("STEvent");
|
||||
node.SetAttribute("name", item.Name);
|
||||
node.SetAttribute("Red", item.IsRed ? "on" : item.IsRedBlinking ? "blinking" : "off");
|
||||
node.SetAttribute("Yellow", item.IsYellow ? "on" : item.IsYellowBlinking ? "blinking" : "off");
|
||||
node.SetAttribute("Blue", item.IsBlue ? "on" : item.IsBlueBlinking ? "blinking" : "off");
|
||||
node.SetAttribute("Green", item.IsGreen ? "on" : item.IsGreenBlinking ? "blinking" : "off");
|
||||
node.SetAttribute("Buzzer", item.IsBuzzer ? "on" : item.IsBuzzerBlinking ? "blinking" : "off");
|
||||
nodeGroup.AppendChild(node);
|
||||
}
|
||||
|
||||
QueryDataClient.Instance.Service.SetTypedConfigContent("SignalTower", "", _xmlSignalTower.InnerXml);
|
||||
}
|
||||
|
||||
public void CancelSelection()
|
||||
{
|
||||
try
|
||||
{
|
||||
var items = _xmlSignalTower.SelectNodes($"STEvents/STEvent");
|
||||
|
||||
foreach (var item in items)
|
||||
{
|
||||
XmlElement element = item as XmlElement;
|
||||
|
||||
SignalTowerItem stItem = SignalTowerData.FirstOrDefault(x => x.Name == element.GetAttribute("name"));
|
||||
|
||||
if (stItem == null)
|
||||
continue;
|
||||
|
||||
stItem.IsRed = string.Compare(element.GetAttribute("Red"), "on", StringComparison.CurrentCultureIgnoreCase) == 0;
|
||||
stItem.IsRedBlinking = string.Compare(element.GetAttribute("Red"), "blinking", StringComparison.CurrentCultureIgnoreCase) == 0;
|
||||
|
||||
stItem.IsYellow = string.Compare(element.GetAttribute("Yellow"), "on", StringComparison.CurrentCultureIgnoreCase) == 0;
|
||||
stItem.IsYellowBlinking = string.Compare(element.GetAttribute("Yellow"), "blinking", StringComparison.CurrentCultureIgnoreCase) == 0;
|
||||
|
||||
stItem.IsGreen = string.Compare(element.GetAttribute("Green"), "on", StringComparison.CurrentCultureIgnoreCase) == 0;
|
||||
stItem.IsGreenBlinking = string.Compare(element.GetAttribute("Green"), "blinking", StringComparison.CurrentCultureIgnoreCase) == 0;
|
||||
|
||||
stItem.IsBlue = string.Compare(element.GetAttribute("Blue"), "on", StringComparison.CurrentCultureIgnoreCase) == 0;
|
||||
stItem.IsBlueBlinking = string.Compare(element.GetAttribute("Blue"), "blinking", StringComparison.CurrentCultureIgnoreCase) == 0;
|
||||
|
||||
stItem.IsBuzzer = string.Compare(element.GetAttribute("Buzzer"), "on", StringComparison.CurrentCultureIgnoreCase) == 0;
|
||||
stItem.IsBuzzerBlinking = string.Compare(element.GetAttribute("Buzzer"), "blinking", StringComparison.CurrentCultureIgnoreCase) == 0;
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LOG.Write(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user