public void Remove(GUIWidget widget) { ISelectable selectable = widget as ISelectable; IEventListener <InputKeyEvent> keyListener = widget as IEventListener <InputKeyEvent>; if (selectable != null) { RemoveSelectable(selectable); } if (keyListener != null) { InputKeyListeners.Remove(keyListener); } Widgets.Remove(widget); }
public void Add(GUIWidget widget) { ISelectable selectable = widget as ISelectable; IEventListener <InputKeyEvent> keyListener = widget as IEventListener <InputKeyEvent>; if (selectable != null) { AddSelectable(selectable); } if (keyListener != null) { InputKeyListeners.Add(keyListener); } Widgets.Add(widget); }