Esempio n. 1
0
 public void SelectValue(short value)
 {
     if (!IsInitialized)
     {
         return;
     }
     try
     {
         for (ushort i = 0; i < PropertyValues.Count(); i++)
         {
             if (PropertyValues[i] == value)
             {
                 SelectValueByIndex((ushort)(i + 1));
                 return;
             }
         }
         Element.AttributeValue = value;
         ReportValueChange(0, value);
     }
     catch (Exception ex)
     {
         Debug.PrintLine("Exception encountered while updating Signed Analog Property Interlock.");
         Debug.PrintLine(ex.Message);
     }
 }
Esempio n. 2
0
 public void SelectValueByIndex(ushort propertyIndex)
 {
     if (!IsInitialized)
     {
         return;
     }
     if (propertyIndex < 1 || propertyIndex > PropertyValues.Count())
     {
         Debug.PrintLine("Couldn't update value for Signed Analog Property Interlock. The index value was out of range.");
         return;
     }
     try
     {
         if (Element.AttributeValue != PropertyValues[propertyIndex - 1])
         {
             Element.AttributeValue = PropertyValues[propertyIndex - 1];
             ReportValueChange(propertyIndex, Element.AttributeValue);
         }
     }
     catch (Exception ex)
     {
         Debug.PrintLine("Exception encountered while updating Signed Analog Property Interlock.");
         Debug.PrintLine(ex.Message);
     }
 }