コード例 #1
0
 internal override DropAction ModelDrop(Root root, LineModel dropModel, bool doDrop)
 {
     if (dropModel.Item is TableX tx)
     {
         if (doDrop)
         {
             ItemLinked.Record(root, root.Get <Relation_StoreX_ChildRelation>(), tx, RX);
         }
         return(DropAction.Link);
     }
     return(DropAction.None);
 }
コード例 #2
0
        internal bool LinkArrow(LinkingArrow arrow, MapItem destinationItem,
                                bool manual)
        {
            bool cancelled = false;

            ItemLinking?.Invoke(arrow.SourceItem, destinationItem, out cancelled);

            if (!cancelled)
            {
                arrow.Link(destinationItem);
                destinationItem.LinkingArrows.Add(arrow);
                arrow.SourceItem.RightLinkPoint.Selected   =
                    destinationItem.LeftLinkPoint.Selected = true;
                if (CurrentLinkingArrow == arrow)
                {
                    CurrentLinkingArrow = null;
                }

                ItemLinked?.Invoke(arrow.SourceItem, destinationItem, manual);
            }

            return(!cancelled);
        }