private void QueueChat(string msg, bool pm) { DiagnosticServices.Chat_QueueChat(this.BotBits); var channel = GetChannel(msg, pm); this.Enqueue(msg, channel); }
protected override Action GetBinder(object baseObj, MethodInfo eventHandler) { var t = this.GetEventType(eventHandler); var genericBind = _bindMethod.MakeGenericMethod(t); DiagnosticServices.Eventloader_GetBinder(this.BotBits, t, eventHandler); return(() => genericBind.Invoke(this, new[] { baseObj, eventHandler })); }
internal void BindInternal([CanBeNull] Assembly assembly, EventRaiseHandler <T> callback, GlobalPriority globalPriority, EventPriority priority) { var extensionId = ExtensionServices.GetExtensionId(this.BotBits, assembly); DiagnosticServices.EventHandle_BindInternal <T>(this.BotBits, extensionId.HasValue); lock (this._eventHandlers) { this._eventHandlers.Add(globalPriority, extensionId ?? int.MaxValue, priority, callback); } }
private void Bind <TEvent>(object baseObj, MethodInfo eventHandler) where TEvent : Event <TEvent> { var attribute = (EventListenerAttribute) eventHandler.GetCustomAttributes(typeof(EventListenerAttribute), true)[0]; var handler = (EventRaiseHandler <TEvent>) Delegate.CreateDelegate(typeof(EventRaiseHandler <TEvent>), baseObj, eventHandler); DiagnosticServices.WithDiagnosticsDisabled(() => { Event <TEvent> .Of(this.BotBits) .Bind(handler, attribute.GlobalPriority, attribute.Priority); }); }
public override void Load(object obj) { DiagnosticServices.Eventloader_Load(obj.GetType()); base.Load(obj); }
public override void LoadStatic <TType>() { DiagnosticServices.Eventloader_LoadStatic <TType>(); base.LoadStatic <TType>(); }
public IEnumerator <Player> GetEnumerator() { DiagnosticServices.GetEnumerator <Players>(this.BotBits); return(this._players.Values.Where(p => p.Connected).GetEnumerator()); }