OpenMetaverse.Inventory.this C# (CSharp) Method

this() public method

By using the bracket operator on this class, the program can get the InventoryObject designated by the specified uuid. If the value for the corresponding UUID is null, the call is equivelant to a call to RemoveNodeFor(this[uuid]). If the value is non-null, it is equivelant to a call to UpdateNodeFor(value), the uuid parameter is ignored.
public this ( UUID uuid ) : InventoryBase
uuid UUID The UUID of the InventoryObject to get or set, ignored if set to non-null value.
return InventoryBase
        public InventoryBase this[UUID uuid]
        {
            get
            {
                InventoryNode node = Items[uuid];
                return node.Data;
            }
            set
            {
                if (value != null)
                {
                    // Log a warning if there is a UUID mismatch, this will cause problems
                    if (value.UUID != uuid)
                        Logger.Log("Inventory[uuid]: uuid " + uuid.ToString() + " is not equal to value.UUID " +
                            value.UUID.ToString(), Helpers.LogLevel.Warning, Client);

                    UpdateNodeFor(value);
                }
                else
                {
                    InventoryNode node;
                    if (Items.TryGetValue(uuid, out node))
                    {
                        RemoveNodeFor(node.Data);
                    }
                }
            }
        }