protected override void Create(ServiceProvider provider) { base.Create(provider); this.OnIncomingMessageTypeRecieved = DictionaryHelper.BuildEnumDictionary <NetIncomingMessageType, OnEventDelegate <IPeer, NetIncomingMessage> >(); this.OnIncomingMessageRecieved += this.HandleIncomingMessageRecieved; }
internal TypeInfo(Type type) { this.Type = type; this.PrettyName = type.GetPrettyName(); this.Members = DictionaryHelper.BuildEnumDictionary <MemberTypes, MemberInfo[]>( with: this.Type.GetMembers(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) .Where(mi => !mi.IsDefined(typeof(CompilerGeneratedAttribute))) .GroupBy(m => m.MemberType) .ToDictionary( keySelector: g => g.Key, elementSelector: g => g.ToArray()), fallback: new MemberInfo[0]); }
protected override void PreInitialize(ServiceProvider provider) { base.PreInitialize(provider); provider.Service(out _buttons); _mButtons = new Dictionary <InputButton, InputButtonManager>(3); _mButtons[new InputButton(MouseButton.Left)] = _buttons[MouseButton.Left]; _mButtons[new InputButton(MouseButton.Middle)] = _buttons[MouseButton.Middle]; _mButtons[new InputButton(MouseButton.Right)] = _buttons[MouseButton.Right]; this.OnButtonState = DictionaryHelper.BuildEnumDictionary <ButtonState, OnEventDelegate <InputButtonManager, InputButtonArgs> >(); _mButtons.Values.ForEach(i => { i.OnStateChanged += this.HandleInputChanged; }); }
protected override void PreInitialize(ServiceProvider provider) { base.PreInitialize(provider); this.OnState = DictionaryHelper.BuildEnumDictionary <ButtonState, OnEventDelegate <InputButtonManager, InputButtonArgs> >(); }