コード例 #1
0
        /// <summary>
        /// unlinks a target from a source. Either src or target has this shape as owner
        /// </summary>
        /// <param name="src">the link source</param>
        /// <param name="target">the link target</param>
        public override void OnUnlink(ShapeLink src, ShapeLink target)
        {
            base.OnUnlink(src, target);

            // Ignore links which don't belong to us
            if (src.OwnerShape != this)
            {
                return;
            }

            // Get the anchor the target link points to
            AnchorShape anchorShape = GetAnchorFromLink(target);

            if (anchorShape == null || !HasEngineInstance())
            {
                return;
            }

            bool bResult = EngineConstraintInstance.RemoveAnchor((long)anchorShape.UniqueID);

            Debug.Assert(bResult == true);
        }