void AlertControl_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e) { switch (Value) { case SpikePositions.Forward: Value = SpikePositions.Off; break; case SpikePositions.Off: Value = SpikePositions.Reverse; break; case SpikePositions.Reverse: default: Value = SpikePositions.Forward; break; } if (DataUpdated != null) DataUpdated(this, new ZomBDataControlUpdatedEventArgs(ControlName, ((int)Value).ToString())); }
public override void UpdateControl(ZomBDataObject value) { if (this.InvokeRequired) { this.Invoke(new Utils.ZomBDataFunction(UpdateControl), value); } else { Value = (SpikePositions)int.Parse(value); } }
public override void UpdateControl(ZomBDataObject value) { base.UpdateControl(value); try { if (0 != (value.TypeHint & (ZomBDataTypeHint.Number | ZomBDataTypeHint.Boolean)) || DoubleValue.ToString() == StringValue) { if (DoubleValue == 0) Value = SpikePositions.Off; else if (DoubleValue > 0) Value = SpikePositions.Forward; else Value = SpikePositions.Reverse; } else Value = (SpikePositions)Enum.Parse(typeof(SpikePositions), StringValue); } catch { } }