src/Misc/EFTools/EntityDesignEntityDesigner/CustomCode/Diagram/EntityDesignerDiagram.cs
/// <summary>
///     Returns the first selection item in the provided selection.
/// </summary>
/// <param name="currentSelection"></param>
/// <param name="proposedShapesToAdd"></param>
/// <param name="proposedShapesToRemove"></param>
/// <returns></returns>
Returns the first selection item in the provided selection.
Returns the first selection item in the provided selection .
private static DiagramItem FirstSelectionItem(
            SelectedShapesCollection currentSelection, DiagramItemCollection proposedShapesToAdd,
            DiagramItemCollection proposedShapesToRemove)
        {
            var actualSelection = new DiagramItemCollection();
            foreach (DiagramItem item in currentSelection)
            {
                if (item != null
                    && actualSelection.Contains(item) == false)
                {
                    actualSelection.Add(item);
                }
            }
            foreach (var item in proposedShapesToAdd)
            {
                if (item != null
                    && actualSelection.Contains(item) == false)
                {
                    actualSelection.Add(item);
                }
            }
            foreach (var item in proposedShapesToRemove)
            {
                if (item != null
                    && actualSelection.Contains(item))
                {
                    actualSelection.Remove(item);
                }
            }
            if (actualSelection.Count > 0)
            {
                return actualSelection[0];
            }
            return null;
        }
private static DiagramItem FirstSelectionItem ( SelectedShapesCollection currentSelection , DiagramItemCollection proposedShapesToAdd , DiagramItemCollection proposedShapesToRemove ) { var actualSelection = new DiagramItemCollection ( ) ; foreach ( DiagramItem item in currentSelection ) { if ( item != null && actualSelection . Contains ( item ) == false ) { actualSelection . Add ( item ) ; } } foreach ( var item in proposedShapesToAdd ) { if ( item != null && actualSelection . Contains ( item ) == false ) { actualSelection . Add ( item ) ; } } foreach ( var item in proposedShapesToRemove ) { if ( item != null && actualSelection . Contains ( item ) ) { actualSelection . Remove ( item ) ; } } if ( actualSelection . Count > 0 ) { return actualSelection [ 0 ] ; } return null ; }
Returns the first selection item in the provided selection.
Returns the first selection item in the provided selection .
// Temporary list that stores what the selections will look like. // Add current selection items to the list. // Include additional diagram items that will be selected. // Remove diagram items that will be unselected. // Return the first item in the list.
None
currentSelection
SelectedShapesCollection
None
proposedShapesToAdd
DiagramItemCollection
None
proposedShapesToRemove
DiagramItemCollection
None