コード例 #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
ファイル: ControlPointsGraphic.cs プロジェクト: nhannd/Xian
		private void Initialize()
		{
			if (_stretchCursorTokenStrategy == null)
				_stretchCursorTokenStrategy = new CompassStretchCursorTokenStrategy();

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

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