Пример #1
0
 /// <summary>
 /// Called when the SecondaryFunction receives a new value, in order to update which
 /// of the outputs exist, and which labels they have.
 /// </summary>
 private void updateIdleValueType(object sender = null,
                                  ValueChangedEventArgs evArgs = null)
 {
     if (mIdleValueType.HasValue)
     {
         if (PortTypes.Bool == mIdleValueType.Value)
         {
             mIdleValue = mTypeService.CreateBool(PortTypes.Bool, "IdleValue");
         }
         else if (PortTypes.Integer == mIdleValueType.Value)
         {
             mIdleValue = mTypeService.CreateInt(PortTypes.Integer, "IdleValue");
         }
         else if (PortTypes.Number == mIdleValueType.Value)
         {
             mIdleValue = mTypeService.CreateDouble(PortTypes.Number, "IdleValue");
         }
         else if (PortTypes.TimeSpan == mIdleValueType.Value)
         {
             mIdleValue = mTypeService.CreateTimeSpan(PortTypes.TimeSpan, "IdleValue");
         }
         else if (PortTypes.Time == mIdleValueType.Value)
         {
             mIdleValue = mTypeService.CreateTimeSpan(PortTypes.Time, "IdleValue");
         }
         else if (PortTypes.Date == mIdleValueType.Value)
         {
             mIdleValue = mTypeService.CreateDateTime(PortTypes.Date, "IdleValue");
         }
         else if (PortTypes.DateTime == mIdleValueType.Value)
         {
             mIdleValue = mTypeService.CreateDateTime(PortTypes.DateTime, "IdleValue");
         }
         else if (PortTypes.String == mIdleValueType.Value)
         {
             mIdleValue = mTypeService.CreateString(PortTypes.String, "IdleValue");
         }
         else
         {
             mIdleValue = null;
         }
     }
     else
     {
         mIdleValue = null;
     }
 }