void ToolbarItemUpdated(int index, MyToolbarItem.ChangeInfo changed) { if (m_items.IsValidIndex(index) && ItemUpdated != null) { ItemUpdated(this, new IndexArgs() { ItemIndex = index }, changed); } }
void ToolbarItemUpdated(MyToolbarItem obj, MyToolbarItem.ChangeInfo changed) { if (ItemUpdated != null) { int index = Array.IndexOf(m_items, obj); if (index != -1) { ItemUpdated(this, new IndexArgs() { ItemIndex = index }, changed); } } }
private void Toolbar_ItemUpdated(MyToolbar toolbar, MyToolbar.IndexArgs args, MyToolbarItem.ChangeInfo changes) { // Quicker method if only icon changed if (changes == MyToolbarItem.ChangeInfo.Icon) { UpdateItemIcon(toolbar, args); } else { UpdateItemAtIndex(toolbar, args.ItemIndex); } }