private void RegisterEventSinks(LauncherItem item) { if (!_events.TryGetValue(item.GameObject, out var eventSinks)) { eventSinks = new LauncherItemEventSink(this, item.GameObject); _events.Add(item.GameObject, eventSinks); } }
private static ContextMenu BuildContextMenu(LauncherItem item) { var c = new ContextMenu(); foreach (var menuItem in item.MenuItems) { c.Items.Add(menuItem); } return(c); }
internal LauncherItem GetItemImpl(IPetroglyhGameableObject gameObject) { var item = TryGetItem(gameObject); if (item == null) { item = new LauncherItem(this, gameObject); AddItem(item); } return(item); }
private void AddItem(LauncherItem item) { _items.Add(item.GameObject, item); RegisterEventSinks(item); }