src/Misc/EFTools/EntityDesignEntityDesigner/CustomCode/Diagram/EntityDesignerDiagram.cs
/// <summary>
///     The event handler when objects are dropped to the designer.
///     If clipboard object is not null, we will go through the objects in the clipboard object and create appropriate Escher objects.
/// </summary>
/// <param name="e"></param>
The event handler when objects are dropped to the designer.
If clipboard object is not null, we will go through the objects in the clipboard object and create appropriate Escher objects.
The event handler when objects are dropped to the designer . If clipboard object is not null we will go through the objects in the clipboard object and create appropriate Escher objects .
public override void OnDragDrop(DiagramDragEventArgs e)
        {
            try
            {
                Arranger.Start(e.IsDropLocationUserSpecified ? e.MousePosition : PointD.Empty);
                if (_clipboardObjects != null)
                {
                    var modelDiagram = ModelElement.ModelXRef.GetExisting(this) as ModelDiagram;
                    var cpc = new CommandProcessorContext(
                        ModelElement.EditingContext, EfiTransactionOriginator.EntityDesignerOriginatorId, EntityDesignerResources.Tx_DropItems);
                    CommandProcessor.InvokeSingleCommand(
                        cpc, 
                        new CreateDiagramItemForEFElementsCommand(
                            GetEFElementNotInDiagramFromClipboardObject(_clipboardObjects),
                            modelDiagram, e.Shift || e.Control));
                }
                else
                {
                    base.OnDragDrop(e);
                }
            }
            finally
            {
                _clipboardObjects = null;
                Arranger.End();
                if (e.IsDropLocationUserSpecified == false)
                {
                    EnsureSelectionVisible();
                }
            }
        }
public override void OnDragDrop ( DiagramDragEventArgs e ) { try { Arranger . Start ( e . IsDropLocationUserSpecified ? e . MousePosition : PointD . Empty ) ; if ( _clipboardObjects != null ) { var modelDiagram = ModelElement . ModelXRef . GetExisting ( this ) as ModelDiagram ; var cpc = new CommandProcessorContext ( ModelElement . EditingContext , EfiTransactionOriginator . EntityDesignerOriginatorId , EntityDesignerResources . Tx_DropItems ) ; CommandProcessor . InvokeSingleCommand ( cpc , new CreateDiagramItemForEFElementsCommand ( GetEFElementNotInDiagramFromClipboardObject ( _clipboardObjects ) , modelDiagram , e . Shift || e . Control ) ) ; } else { base . OnDragDrop ( e ) ; } } finally { _clipboardObjects = null ; Arranger . End ( ) ; if ( e . IsDropLocationUserSpecified == false ) { EnsureSelectionVisible ( ) ; } } }
The event handler when objects are dropped to the designer.
The event handler when objects are dropped to the designer .
e
DiagramDragEventArgs
None