src/Misc/EFTools/EntityDesignModel/Commands/MovePropertiesCommand.cs
/// <summary>
///     Return the number of steps in which the property will be moved.
///     The logic is to return the Math.Min of the # of steps passed in to the command and the # of steps from the property to the previously moved property.
///     If previously moved property is null, just return the # of steps passed in to the command.
/// </summary>
/// <param name="property"></param>
/// <param name="previouslyMovedProperty"></param>
/// <returns></returns>
Return the number of steps in which the property will be moved.
The logic is to return the Math.Min of the # of steps passed in to the command and the # of steps from the property to the previously moved property.
If previously moved property is null, just return the # of steps passed in to the command.
Return the number of steps in which the property will be moved . The logic is to return the Math . Min of the # of steps passed in to the command and the # of steps from the property to the previously moved property . If previously moved property is null just return the # of steps passed in to the command .
private uint GetNumberOfMoveStep(PropertyBase property, PropertyBase previouslyMovedProperty)
        {
            if (previouslyMovedProperty == null)
            {
                return _step;
            }
            uint numberOfSteps = 0;
            var insertLocation = _moveDirection == MoveDirection.Up
                                     ? property.PreviousSiblingInPropertyXElementOrder
                                     : property.NextSiblingInPropertyXElementOrder;
            for (; numberOfSteps < _step && insertLocation != null && insertLocation != previouslyMovedProperty; numberOfSteps++)
            {
                insertLocation = _moveDirection == MoveDirection.Up
                                     ? insertLocation.PreviousSiblingInPropertyXElementOrder
                                     : insertLocation.NextSiblingInPropertyXElementOrder;
            }
            return numberOfSteps;
        }
private uint GetNumberOfMoveStep ( PropertyBase property , PropertyBase previouslyMovedProperty ) { if ( previouslyMovedProperty == null ) { return _step ; } uint numberOfSteps = 0 ; var insertLocation = _moveDirection == MoveDirection . Up ? property . PreviousSiblingInPropertyXElementOrder : property . NextSiblingInPropertyXElementOrder ; for ( ; numberOfSteps < _step && insertLocation != null && insertLocation != previouslyMovedProperty ; numberOfSteps ++ ) { insertLocation = _moveDirection == MoveDirection . Up ? insertLocation . PreviousSiblingInPropertyXElementOrder : insertLocation . NextSiblingInPropertyXElementOrder ; } return numberOfSteps ; }
Return the number of steps in which the property will be moved.
Return the number of steps in which the property will be moved .
None
property
PropertyBase
None
previouslyMovedProperty
PropertyBase
None