Пример #1
0
        /// <summary>
        /// For performance reasons, we don't call EhSelfChanged during the suspended state. Instead, when we resume here, we compare the saved state of this instance with the current state of the instance
        /// and and set our accumulated data accordingly.
        /// </summary>
        protected override void OnResume()
        {
            BoundariesChangedData data = 0;

            // if anything changed in the meantime, fire the event
            if (_savedNumberOfItems != _numberOfItems)
            {
                data |= BoundariesChangedData.NumberOfItemsChanged;
            }

            if (_cachedMinValue != _minValue)
            {
                data |= BoundariesChangedData.LowerBoundChanged;
            }

            if (_cachedMaxValue != _maxValue)
            {
                data |= BoundariesChangedData.UpperBoundChanged;
            }

            if (0 != data)
            {
                if (null == _accumulatedEventData)
                {
                    _accumulatedEventData = new BoundariesChangedEventArgs(data);
                }
                else
                {
                    _accumulatedEventData.Add(new BoundariesChangedEventArgs(data));
                }
            }

            base.OnResume();
        }
Пример #2
0
    /// <summary>
    /// This handler is called if a y-boundary from any of the plotassociations of this layer
    /// has changed. We then have to recalculate the boundaries.
    /// </summary>
    /// <param name="sender">The plotassociation that has caused the boundary changed event.</param>
    /// <param name="e">The boundary changed event args.</param>
    /// <remarks>Unfortunately we do not know if the boundary is extended or shrinked, if is is extended
    /// if would be possible to merge only the changed boundary into the y-axis boundary.
    /// But since we don't know about that, we have to completely recalculate the boundary be using the boundaries of
    /// all PlotAssociations of this layer.</remarks>
    public void OnPlotAssociationYBoundariesChanged(object sender, BoundariesChangedEventArgs e)
    {
      if (0 == _plotAssociationYBoundariesChanged_EventSuspendCount)
      {
        // now we have to inform all the PlotAssociations that a new axis was loaded
        _linkedScales.Y.Scale.DataBoundsObject.BeginUpdate();
        _linkedScales.Y.Scale.DataBoundsObject.Reset();
        foreach (IGPlotItem pa in this.PlotItems)
        {
          if (pa is IYBoundsHolder)
          {
            // merge the bounds with x and yAxis
            ((IYBoundsHolder)pa).MergeYBoundsInto(_linkedScales.Y.Scale.DataBoundsObject); // merge all x-boundaries in the x-axis boundary object

          }
        }
        _linkedScales.Y.Scale.DataBoundsObject.EndUpdate();
      }
    }
Пример #3
0
		protected void EhBoundariesChanged(object sender, BoundariesChangedEventArgs e)
		{
			ProcessDataBounds(); // calculate new bounds and fire AxisChanged event
		}
Пример #4
0
 void EhYBoundariesChanged(object sender, BoundariesChangedEventArgs args)
 {
   if (null != YBoundariesChanged)
     YBoundariesChanged(this, args);
 }
Пример #5
0
    protected virtual void EhYBoundariesChanged(object sender, BoundariesChangedEventArgs e)
    {
      if (_SupressBoundaryChangeEvents == 0)
      {
        if (null != this.YBoundariesChanged)
          YBoundariesChanged(this, e);

        OnChanged();
      }
    }
Пример #6
0
		protected void OnBoundariesChanged(object sender, BoundariesChangedEventArgs e)
		{
			bool bIsRelevant = true;

			if (bIsRelevant) // if something really relevant changed
			{
				ProcessDataBounds(); // calculate new bounds and fire AxisChanged event
			}
		}
Пример #7
0
		protected override void OnResume()
		{
			BoundariesChangedData data = 0;
			// if anything changed in the meantime, fire the event
			if (this._savedNumberOfItems != this._numberOfItems)
				data |= BoundariesChangedData.NumberOfItemsChanged;

			if (this._cachedMinValue != this._minValue)
				data |= BoundariesChangedData.LowerBoundChanged;
			if (this._cachedMaxValue != this._maxValue)
				data |= BoundariesChangedData.UpperBoundChanged;

			if (0 != data)
				_accumulatedEventData = new BoundariesChangedEventArgs(data);

			base.OnResume();
		}
Пример #8
0
		protected void EhBoundaryChangedEventFromPlotItem(BoundariesChangedEventArgs boundaryChangedEventArgs)
		{
			var data = boundaryChangedEventArgs.Data;
			if (data.HasFlag(BoundariesChangedData.XBoundariesChanged))
				EhXBoundaryChangedEventFromPlotItem();
			if (data.HasFlag(BoundariesChangedData.YBoundariesChanged))
				EhYBoundaryChangedEventFromPlotItem();
			if (data.HasFlag(BoundariesChangedData.ZBoundariesChanged))
				EhZBoundaryChangedEventFromPlotItem();
		}