Exemple #1
0
 /// <summary>
 /// If a new child shape was not placed, then defer to
 /// PlaceAsChildOf on the child. Note that AutoResize
 /// has not been called on the child prior to this call.
 /// </summary>
 /// <param name="child">A new child shape element</param>
 /// <param name="childWasPlaced">false if the child element was not previously placed.</param>
 /// <param name="createdDuringViewFixup">Whether this shape was created as part of a view fixup</param>
 protected override void OnChildConfigured(ShapeElement child, bool childWasPlaced, bool createdDuringViewFixup)
 {
     // Don't check childWasPlaced here during drag-drop. In this case,
     // childWasPlace will be true if the parent shape was placed, so is
     // only relevant for our code base for the top-level shapes, in which
     // case the OnChildConfigured for the dropped shape is called on the
     // diagram, not a base shape. Any derived shape that allows placed
     // drag from the toolbox (etc) onto child shapes (which none of
     // the shapes in ORMShapeDomainModel allow), then childWasPlaced should
     // be tested.
     if (childWasPlaced)
     {
         Transaction transaction = Store.TransactionManager.CurrentTransaction.TopLevelTransaction;
         if (transaction != null &&
             (DropTargetContext.HasDropTargetContext(transaction) ||
              transaction.Context.ContextInfo.ContainsKey(ORMBaseShape.PlaceAllChildShapes)))
         {
             childWasPlaced = false;
         }
     }
     if (!childWasPlaced)
     {
         ORMBaseShape baseShape;
         if (null != (baseShape = child as ORMBaseShape))
         {
             baseShape.PlaceAsChildOf(this, createdDuringViewFixup);
         }
     }
 }
 /// <summary>
 /// Stop all auto shape selection on transaction commit except when
 /// the item is being dropped.
 /// </summary>
 public override IList FixUpDiagramSelection(ShapeElement newChildShape)
 {
     if (DropTargetContext.HasDropTargetContext(Store.TransactionManager.CurrentTransaction))
     {
         return(base.FixUpDiagramSelection(newChildShape));
     }
     return(null);
 }