Esempio n. 1
0
        public override void ScrollToValue(double position)
        {
            double num = this.ActualViewMaximum - this.ActualViewMinimum;
            double min = position;
            double max = position + num;

            RangeHelper.BoxRangeInsideAnother(ref min, ref max, this.ActualMinimum, this.ActualMaximum);
            double precision = DoubleHelper.GetPrecision(new double[2]
            {
                min,
                this.ActualViewMinimum
            });

            if (DoubleHelper.EqualsWithPrecision(min, this.ActualViewMinimum, precision))
            {
                return;
            }
            this._majorSequence.MoveToCover((DoubleR10)min, (DoubleR10)max);
            this.CalculateMinorSequence(this.MaxCount * 5, this.GetMaxAllowedMargin(this.MaxCount));
            this.BeginInit();
            this.ViewMinimum = new double?(this.ActualViewMinimum = min);
            this.ViewMaximum = new double?(this.ActualViewMaximum = max);
            this.IsScrolling = true;
            this.EndInit();
        }
Esempio n. 2
0
        public override void ScrollToValue(double position)
        {
            double num         = this.ActualViewMaximum - this.ActualViewMinimum;
            double viewMinimum = position;
            double viewMaximum = position + num;

            this.BoxViewRange(ref viewMinimum, ref viewMaximum);
            double precision = DoubleHelper.GetPrecision(new double[2]
            {
                viewMinimum,
                this.ActualViewMinimum
            });

            if (DoubleHelper.EqualsWithPrecision(viewMinimum, this.ActualViewMinimum, precision))
            {
                return;
            }
            this._majorSequence.MoveToCover((DoubleR10)viewMinimum, (DoubleR10)viewMaximum);
            this._minorSequence.MoveToCover((DoubleR10)viewMinimum, (DoubleR10)viewMaximum);
            this.BeginInit();
            this.ViewMinimum = new double?(this.ActualViewMinimum = viewMinimum);
            this.ViewMaximum = new double?(this.ActualViewMaximum = viewMaximum);
            this.IsScrolling = true;
            this.RealizeCategories();
            this.EndInit();
        }
Esempio n. 3
0
        public override double ConvertToPercent(object value)
        {
            if (value == null)
            {
                return(double.NaN);
            }
            double         num        = Convert.ToDouble(value, (IFormatProvider)CultureInfo.InvariantCulture);
            Range <double> fromRange  = new Range <double>(this.ActualMinimum, this.ActualMaximum);
            double         precision1 = DoubleHelper.GetPrecision(num, fromRange.Minimum, fromRange.Maximum);

            if (DoubleHelper.LessWithPrecision(num, fromRange.Minimum, precision1) || DoubleHelper.GreaterWithPrecision(num, fromRange.Maximum, precision1))
            {
                return(double.NaN);
            }
            double precision2 = DoubleHelper.GetPrecision(1, new double[0]);

            return(DoubleHelper.RoundWithPrecision(RangeHelper.Project(fromRange, num, Scale.PercentRange), precision2));
        }