SilverlightMappingToolBasic.UI.SuperGraph.View.SuperGraphControl.AutoRealign C# (CSharp) Method

AutoRealign() public method

This method is for automatical realignment, it will realigns the map (horizontally or vertically) based on last realign operation. If there is no realign action occurred, it will realign the map horizontally.
public AutoRealign ( NodeControl focusedControl = null ) : void
focusedControl SilverlightMappingToolBasic.UI.SuperGraph.View.NodeControlSupportClasses.NodeControl /// If focusedControl has been set, it will automatically moves the map to make sure the focused control not being /// moved. ///
return void
        public void AutoRealign(NodeControl focusedControl = null)
        {
            var lastPosition = new Point();
            if (focusedControl != null)
            {
                lastPosition = focusedControl.ViewModelNode.Location;
            }
            if (RealignFactory.RealignStyle == RealignStyle.Horizontal)
            {
                HorizontalRealign();
            }
            else
            {
                VerticalRealign();
            }

            if (focusedControl != null)
            {
                var currentPosintion = focusedControl.ViewModelNode.Location;
                var difference = currentPosintion.Subtract(lastPosition);
                MoveMap(-difference.X, -difference.Y);
            }
        }
SuperGraphControl