public virtual bool Select(SpatialTargetDispatcher dispatcher, SurfaceData data)
        {
            if (!IsSelectable)
            {
                return(false);
            }

            if (ActivatingDispatcher != null && ActivatingDispatcher != dispatcher)
            {
                ActivatingDispatcher.RemoveFromSelectedTargets(this);
            }

            ActivatingDispatcher = dispatcher;
            return(Select(data));
        }
        public virtual bool Deselect(bool keepInActivatingDispatcher = false)
        {
            if (!IsSelectable || !IsActivated)
            {
                return(false);
            }

            IsActivated = false;
            if (ActivatingDispatcher != null)
            {
                if (!keepInActivatingDispatcher)
                {
                    ActivatingDispatcher.RemoveFromSelectedTargets(this);
                }
                ActivatingDispatcher = null;
            }
            Deactivated?.Invoke();

            return(true);
        }
 /// <summary>
 /// Reacts to <see cref="SurfaceData"/> selecting on target spatial location.
 /// </summary>
 /// <param name="dispatcher">The dispatcher calling the method.</param>
 /// <param name="data">The selecting data.</param>
 public virtual void DoSelect(SpatialTargetDispatcher dispatcher, SurfaceData data)
 {
     Select(dispatcher, data);
 }