コード例 #1
0
 private void RegisterEventSinks(LauncherItem item)
 {
     if (!_events.TryGetValue(item.GameObject, out var eventSinks))
     {
         eventSinks = new LauncherItemEventSink(this, item.GameObject);
         _events.Add(item.GameObject, eventSinks);
     }
 }
コード例 #2
0
            private static ContextMenu BuildContextMenu(LauncherItem item)
            {
                var c = new ContextMenu();

                foreach (var menuItem in item.MenuItems)
                {
                    c.Items.Add(menuItem);
                }
                return(c);
            }
コード例 #3
0
        internal LauncherItem GetItemImpl(IPetroglyhGameableObject gameObject)
        {
            var item = TryGetItem(gameObject);

            if (item == null)
            {
                item = new LauncherItem(this, gameObject);
                AddItem(item);
            }

            return(item);
        }
コード例 #4
0
 private void AddItem(LauncherItem item)
 {
     _items.Add(item.GameObject, item);
     RegisterEventSinks(item);
 }