OpenMetaverse.InventoryManager.MoveItems C# (CSharp) Method

MoveItems() public method

Move multiple inventory items to new locations
public MoveItems ( UUID>.Dictionary itemsNewParents ) : void
itemsNewParents UUID>.Dictionary A Dictionary containing the /// of the source item as the key, and the /// of the destination folder as the value
return void
        public void MoveItems(Dictionary<UUID, UUID> itemsNewParents)
        {
            lock (_Store)
            {
                foreach (KeyValuePair<UUID, UUID> entry in itemsNewParents)
                {
                    if (_Store.Contains(entry.Key))
                    {
                        InventoryBase inv = _Store[entry.Key];
                        inv.ParentUUID = entry.Value;
                        _Store.UpdateNodeFor(inv);
                    }
                }
            }

            MoveInventoryItemPacket move = new MoveInventoryItemPacket();
            move.AgentData.AgentID = _Client.Self.AgentID;
            move.AgentData.SessionID = _Client.Self.SessionID;
            move.AgentData.Stamp = false; //FIXME: ??

            move.InventoryData = new MoveInventoryItemPacket.InventoryDataBlock[itemsNewParents.Count];

            int index = 0;
            foreach (KeyValuePair<UUID, UUID> entry in itemsNewParents)
            {
                MoveInventoryItemPacket.InventoryDataBlock block = new MoveInventoryItemPacket.InventoryDataBlock();
                block.ItemID = entry.Key;
                block.FolderID = entry.Value;
                block.NewName = new byte[0];
                move.InventoryData[index++] = block;
            }

            _Client.Network.SendPacket(move);
        }