void MonitorInventory(object sender, InventoryChangedEventArgs e) { Player parent = (sender as Inventory).Parent as Player; if (parent == null) { return; } parent.CancelTrade(); }
public Item this[int index] { get { return(items[index]); } set { if (items[index] != value) { var e = new InventoryChangedEventArgs(index, items[index], value); items[index] = value; if (InventoryChanged != null) { InventoryChanged(this, e); } } } }
void MonitorInventory(object sender, InventoryChangedEventArgs e) { Player parent = (sender as Inventory).Parent as Player; parent?.CancelTrade(); }