CCT.NUI.StartMenu.Model.Menu.RelocateItem C# (CSharp) Method

RelocateItem() public method

public RelocateItem ( IMenuItem item, int newIndex ) : void
item IMenuItem
newIndex int
return void
        public void RelocateItem(IMenuItem item, int newIndex)
        {
            var indexOf = this.items.IndexOf(item);
            if (newIndex == indexOf)
            {
                return;
            }
            if (newIndex > indexOf)
            {
                newIndex--;
            }
            this.items.Remove(item);
            this.items.Insert(newIndex, item);
        }