private void SetupOldAxis(int idx, Altaxo.Graph.Scales.Deprecated.Scale axis, bool isLinked, double orgA, double orgB, double endA, double endB)
		{
			Scale transScale = null;
			if (axis is Altaxo.Graph.Scales.Deprecated.TextScale)
				transScale = new TextScale();
			else if (axis is Altaxo.Graph.Scales.Deprecated.DateTimeScale)
				transScale = new DateTimeScale();
			else if (axis is Altaxo.Graph.Scales.Deprecated.Log10Scale)
				transScale = new Log10Scale();
			else if (axis is Altaxo.Graph.Scales.Deprecated.AngularScale)
				transScale = (axis as Altaxo.Graph.Scales.Deprecated.AngularScale).UseDegrees ? (Scale)new AngularDegreeScale() : (Scale)new AngularRadianScale();
			else if (axis is Altaxo.Graph.Scales.Deprecated.LinearScale)
				transScale = new LinearScale();
			else
				throw new ArgumentException("Axis type unknown");

			if (transScale.RescalingObject is IUnboundNumericScaleRescaleConditions)
				(transScale.RescalingObject as IUnboundNumericScaleRescaleConditions).SetUserParameters(BoundaryRescaling.AutoTempFixed, BoundariesRelativeTo.Absolute, axis.OrgAsVariant, BoundaryRescaling.AutoTempFixed, BoundariesRelativeTo.Absolute, axis.EndAsVariant);

			if (transScale.RescalingObject is Altaxo.Graph.Scales.Rescaling.NumericScaleRescaleConditions &&
				axis.RescalingObject is Altaxo.Graph.Scales.Rescaling.NumericScaleRescaleConditions)
			{
				((Altaxo.Graph.Scales.Rescaling.NumericScaleRescaleConditions)transScale.RescalingObject).CopyFrom((Altaxo.Graph.Scales.Rescaling.NumericScaleRescaleConditions)axis.RescalingObject);
			}

			if (isLinked)
			{
#pragma warning disable CS0618 // Type or member is obsolete
				LinkedScale ls = new LinkedScale(transScale, idx);
#pragma warning restore CS0618 // Type or member is obsolete
				ls.SetLinkParameter(orgA, orgB, endA, endB);
				transScale = ls;
			}

			_scales[idx] = transScale;
		}
    protected void SetLinkedScale(LinkedScale newvalue, int i)
    {
      LinkedScale oldvalue = _linkedScales[i];
      _linkedScales[i] = newvalue;

      if (!object.ReferenceEquals(oldvalue, newvalue))
      {
        if (null != oldvalue)
          oldvalue.LinkPropertiesChanged -= new EventHandler(EhLinkPropertiesChanged);
        if (null != newvalue)
          newvalue.LinkPropertiesChanged += new EventHandler(EhLinkPropertiesChanged);
      }
    }
Example #3
0
 public LinkedScale Clone()
 {
   LinkedScale result = new LinkedScale();
   result.CopyFrom(this);
   return result;
 }
Example #4
0
		public override object Clone()
		{
			LinkedScale result = new LinkedScale();
			result.CopyFrom(this);
			return result;
		}
Example #5
0
 void CopyFrom(LinkedScale from)
 {
   this.Scale = from._scale == null ? null : (Scale)from._scale.Clone();
   this._isLinked = from._isLinked;
   this._linkOrgA = from._linkOrgA;
   this._linkOrgB = from._linkOrgB;
   this._linkEndA = from._linkEndA;
   this._linkEndB = from._linkEndB;
 }