private void BtnMRAddSnapPoint_Click(object sender, RoutedEventArgs e) { try { double offset = Convert.ToDouble(txtMRSnapPointOffset.Text); double interval = Convert.ToDouble(txtMRSnapPointInterval.Text); double start = Convert.ToDouble(txtMRSnapPointStart.Text); double end = Convert.ToDouble(txtMRSnapPointEnd.Text); RepeatedScrollSnapPoint newSnapPoint = new RepeatedScrollSnapPoint(offset, interval, start, end, (ScrollSnapPointsAlignment)cmbMRSnapPointAlignment.SelectedIndex); Color fillColor = GetNewColor(); ScrollerTestHooks.SetSnapPointVisualizationColor(newSnapPoint, fillColor); markupScroller.VerticalSnapPoints.Add(newSnapPoint); double value = GetFirstRepeatedSnapPoint(offset, interval, start); List <double> values = new List <double>(); while (value <= end) { values.Add(value); value += interval; } FillSnapPoint(values, start, end, fillColor); FixConsolidatedView(); } catch (Exception ex) { this.fullLogs.Add(ex.ToString()); txtExceptionReport.Text = ex.ToString(); } }
private void BtnORAddSnapPoint_Click(object sender, RoutedEventArgs e) { try { double offset = Convert.ToDouble(txtORSnapPointOffset.Text); double interval = Convert.ToDouble(txtORSnapPointInterval.Text); double range = Convert.ToDouble(txtORApplicableRange.Text); double start = Convert.ToDouble(txtORSnapPointStart.Text); double end = Convert.ToDouble(txtORSnapPointEnd.Text); RepeatedScrollSnapPoint newSnapPoint = new RepeatedScrollSnapPoint(offset, interval, start, end, range, ScrollSnapPointsAlignment.Near); Color fillColor = GetNewColor(); ScrollerTestHooks.SetSnapPointVisualizationColor(newSnapPoint, fillColor); markupScroller.VerticalSnapPoints.Add(newSnapPoint); double value = GetFirstRepeatedSnapPoint(offset, interval, start); int minColumn = FillSnapPoint(new List <double>(), start, end, fillColor); while (value <= end) { FillSnapPoint(new List <double> { value }, Math.Max(start, value - range), Math.Min(end, value + range), fillColor, minColumn); value += interval; } FixConsolidatedView(); } catch (Exception ex) { this.fullLogs.Add(ex.ToString()); txtExceptionReport.Text = ex.ToString(); } }
private void BtnMIAddSnapPoint_Click(object sender, RoutedEventArgs e) { try { double value = Convert.ToDouble(txtMISnapPointValue.Text); ScrollSnapPoint newSnapPoint = new ScrollSnapPoint(value, (ScrollSnapPointsAlignment)cmbMISnapPointAlignment.SelectedIndex); Color fillColor = GetNewColor(); ScrollerTestHooks.SetSnapPointVisualizationColor(newSnapPoint, fillColor); markupScroller.VerticalSnapPoints.Add(newSnapPoint); FillSnapPoint(new List <double> { value }, value, value, fillColor); FixConsolidatedView(); } catch (Exception ex) { this.fullLogs.Add(ex.ToString()); txtExceptionReport.Text = ex.ToString(); } }
private void BtnOIAddSnapPoint_Click(object sender, RoutedEventArgs e) { try { double value = Convert.ToDouble(txtOISnapPointValue.Text); double range = Convert.ToDouble(txtOIApplicableRange.Text); ScrollerSnapPointBase newSnapPoint = new ScrollerSnapPointIrregular(value, range, ScrollerSnapPointAlignment.Near); Color fillColor = GetNewColor(); ScrollerTestHooks.SetSnapPointVisualizationColor(newSnapPoint, fillColor); markupScroller.VerticalSnapPoints.Add(newSnapPoint); FillSnapPoint(new List <double> { value }, (value - range), (value + range), fillColor); FixConsolidatedView(); } catch (Exception ex) { this.fullLogs.Add(ex.ToString()); txtExceptionReport.Text = ex.ToString(); } }