コード例 #1
0
ファイル: TextScale.cs プロジェクト: olesar/Altaxo
        protected override bool HandleHighPriorityChildChangeCases(object sender, ref EventArgs e)
        {
            if (object.ReferenceEquals(sender, _dataBounds)) // Data bounds have changed
            {
                double xorg = 0;
                double xend = 1;
                if (null != _dataBounds && !_dataBounds.IsEmpty)
                {
                    xorg = 0.5;
                    xend = _dataBounds.NumberOfItems + 0.5;
                }

                var rescalingHasChanged = _rescaling.OnDataBoundsChanged(xorg, xend);
                if (!rescalingHasChanged) // Note: the other case (rescaling has changed) is handled in HandleHighPriorityChildChangeCases
                {
                    // even if the data bounds have not changed, we must force the update of the ticks.
                    // Example: the mutual exchange of two elements in a text column will not change the data bounds, but the order of our ticks __will__ change!!
                    UpdateTicksAndOrgEndUsingRescalingObject();
                }

                e = EventArgs.Empty;
                return(false);
            }
            else if (object.ReferenceEquals(sender, _rescaling)) // Rescaling has changed
            {
                UpdateTicksAndOrgEndUsingRescalingObject();
            }
            else if (object.ReferenceEquals(sender, _tickSpacing))
            {
                UpdateTicksAndOrgEndUsingRescalingObject();
            }

            return(base.HandleHighPriorityChildChangeCases(sender, ref e));
        }
コード例 #2
0
ファイル: TextScale.cs プロジェクト: olesar/Altaxo
 public void ProcessDataBounds(double xorg, double xend, NumericScaleRescaleConditions rescaling)
 {
     rescaling.OnDataBoundsChanged(xorg, xend);
     ProcessDataBounds(rescaling.ResultingOrg, rescaling.IsResultingOrgFixed, rescaling.ResultingEnd, rescaling.IsResultingEndFixed);
 }