예제 #1
0
        private void Initialize()
        {
            if (_stretchCursorTokenStrategy == null)
            {
                _stretchCursorTokenStrategy = new CompassStretchCursorTokenStrategy();
            }

            if (_controlPoints == null)
            {
                base.Graphics.Add(_controlPoints = new ControlPointGroup());
            }

            _stretchCursorTokenStrategy.TargetGraphic = this;
            _controlPoints.ControlPointChangedEvent  += OnControlPointLocationChanged;
        }
예제 #2
0
        /// <summary>
        /// Called by <see cref="ControlGraphic"/> in response to the framework requesting the cursor token for a particular screen coordinate via <see cref="ControlGraphic.GetCursorToken"/>.
        /// </summary>
        /// <param name="point">The screen coordinate for which the cursor is requested.</param>
        /// <returns></returns>
        protected override CursorToken GetCursorToken(Point point)
        {
            if (this.IsTracking)
            {
                return(this.StretchingToken);
            }

            if (this.Visible && this.HitTest(point))
            {
                if (this.StretchCursorTokenStrategy != null)
                {
                    return(StretchCursorTokenStrategy.GetCursorToken(point));
                }
            }

            return(base.GetCursorToken(point));
        }
예제 #3
0
		private void Initialize()
		{
			if (_stretchCursorTokenStrategy == null)
				_stretchCursorTokenStrategy = new CompassStretchCursorTokenStrategy();

			if (_controlPoints == null)
				base.Graphics.Add( _controlPoints = new ControlPointGroup());

			_stretchCursorTokenStrategy.TargetGraphic = this;
			_controlPoints.ControlPointChangedEvent += OnControlPointLocationChanged;
		}