private void FilterBandWidthEncoder_DirectionChanged(object sender, DirectionChangedEventArgs e) { z += 1; if (z > 2) { z = 0; } int stepsize = FilterBandwidthDial.CustomStep; if (FilterBandwidthDial.UseAutoStep == true) { stepsize = sharpControl.StepSize; } switch (e.EncoderDirection) { case EncoderDirectionType.Zero: break; case EncoderDirectionType.Negative: try { if (z == 0) { sharpControl.FilterBandwidth -= stepsize; } } catch { } break; case EncoderDirectionType.Positive: try { if (z == 0) { sharpControl.FilterBandwidth += stepsize; } } catch { } break; default: break; } }
private void ZoomEncoder_DirectionChanged(object sender, DirectionChangedEventArgs e) { z += 1; if (z > 2) { z = 0; } switch (e.EncoderDirection) { case EncoderDirectionType.Zero: break; case EncoderDirectionType.Negative: try { if (z == 0) { sharpControl.Zoom -= 1; } } catch { } break; case EncoderDirectionType.Positive: try { if (z == 0) { sharpControl.Zoom += 1; } } catch { } break; default: break; } }
private void FrequencyEncoder_DirectionChanged(object sender, DirectionChangedEventArgs e) { int stepsize = FrequencyEncoder.CustomStep; if (FrequencyEncoder.UseAutoStep == true) { stepsize = sharpControl.StepSize; } switch (e.EncoderDirection) { case EncoderDirectionType.Zero: break; case EncoderDirectionType.Negative: try { sharpControl.Frequency -= stepsize; } catch { } break; case EncoderDirectionType.Positive: try { sharpControl.Frequency += stepsize; } catch { } break; default: break; } }
protected virtual void OnDirectionChanged(DirectionChangedEventArgs e) { DirectionChangedEventHandler handler = DirectionChanged; handler?.Invoke(this, e); }