/// <summary>
        /// Construct a <see cref="ZoomStateGroup"/> object from the scale ranges settings contained
        /// in each <see cref="GraphPane" /> for the specified <see cref="MasterPane"/>.
        /// </summary>
        /// <param name="masterPane">The <see cref="MasterPane"/> from which to obtain the scale
        /// range values.
        /// </param>
        /// <param name="type">A <see cref="ZoomState.StateType"/> enumeration that indicates whether
        /// this saved state is from a pan, zoom, or scroll.</param>
        public ZoomStateGroup( MasterPane masterPane, StateType type )
            : base(type)
        {
            _stack = new ZoomStateStack();

            foreach ( GraphPane pane in masterPane._paneList )
                _stack.Add( new ZoomState( pane, type ) );
        }
        /// <summary>
        /// Construct a <see cref="ZoomStateGroup"/> object from the scale ranges settings contained
        /// in each <see cref="GraphPane" /> for the specified <see cref="MasterPane"/>.
        /// </summary>
        /// <param name="masterPane">The <see cref="MasterPane"/> from which to obtain the scale
        /// range values.
        /// </param>
        /// <param name="type">A <see cref="ZoomState.StateType"/> enumeration that indicates whether
        /// this saved state is from a pan, zoom, or scroll.</param>
        public ZoomStateGroup(MasterPane masterPane, StateType type) : base(type)
        {
            _stack = new ZoomStateStack();

            foreach (GraphPane pane in masterPane._paneList)
            {
                _stack.Add(new ZoomState(pane, type));
            }
        }
示例#3
0
        /// <summary>
        /// Save the current states of the GraphPanes to a separate collection.  Save a single
        /// (<see paramref="primaryPane" />) GraphPane if the panes are not synchronized
        /// (see <see cref="IsSynchronizeXAxes" /> and <see cref="IsSynchronizeYAxes" />),
        /// or save a list of states for all GraphPanes if the panes are synchronized.
        /// </summary>
        /// <param name="primaryPane">The primary GraphPane on which zoom/pan/scroll operations
        /// are taking place</param>
        /// <param name="type">The <see cref="ZoomState.StateType" /> that describes the
        /// current operation</param>
        /// <returns>The <see cref="ZoomState" /> that corresponds to the
        /// <see paramref="primaryPane" />.
        /// </returns>
        private ZoomState ZoomStateSave(GraphPane primaryPane, ZoomState.StateType type)
        {
            ZoomStateClear();

            if (_isSynchronizeXAxes || _isSynchronizeYAxes)
            {
                foreach (GraphPane pane in _masterPane._paneList)
                {
                    ZoomState state = new ZoomState(pane, type);
                    if (pane == primaryPane)
                    {
                        _zoomState = state;
                    }
                    _zoomStateStack.Add(state);
                }
            }
            else
            {
                _zoomState = new ZoomState(primaryPane, type);
            }

            return(_zoomState);
        }
示例#4
0
        /// <summary>
        /// Save the current states of the GraphPanes to a separate collection.  Save a single
        /// (<see paramref="primaryPane" />) GraphPane if the panes are not synchronized
        /// (see <see cref="IsSynchronizeXAxes" /> and <see cref="IsSynchronizeYAxes" />),
        /// or save a list of states for all GraphPanes if the panes are synchronized.
        /// </summary>
        /// <param name="primaryPane">The primary GraphPane on which zoom/pan/scroll operations
        /// are taking place</param>
        /// <param name="type">The <see cref="ZoomState.StateType" /> that describes the
        /// current operation</param>
        /// <returns>The <see cref="ZoomState" /> that corresponds to the
        /// <see paramref="primaryPane" />.
        /// </returns>
        private ZoomState ZoomStateSave(GraphPane primaryPane, ZoomState.StateType type)
        {
            ZoomStateClear();

            if (_isSynchronizeXAxes || _isSynchronizeYAxes)
            {
                foreach (var pane in _masterPane.PaneList.Where(p => p is GraphPane).Cast <GraphPane>())
                {
                    var state = new ZoomState(pane, type);
                    if (pane == primaryPane)
                    {
                        _zoomState = state;
                    }
                    _zoomStateStack.Add(state);
                }
            }
            else
            {
                _zoomState = new ZoomState(primaryPane, type);
            }

            return(_zoomState);
        }