Exemple #1
0
 public void Bind(EventRaiseHandler <T> callback, GlobalPriority globalPriority, EventPriority priority = EventPriority.Normal)
 {
     lock (this._eventHandlers)
     {
         var assembly    = callback.Method.DeclaringType.Assembly;
         var extensionId = ExtensionServices.GetExtensionId(this.BotBits, assembly);
         this._eventHandlers.Add(globalPriority, extensionId ?? int.MaxValue, priority, callback);
     }
 }
Exemple #2
0
 internal void BindInternal([CanBeNull] Assembly assembly, EventRaiseHandler <T> callback, GlobalPriority globalPriority,
                            EventPriority priority)
 {
     lock (this._eventHandlers)
     {
         var extensionId = ExtensionServices.GetExtensionId(this.BotBits, assembly);
         this._eventHandlers.Add(globalPriority, extensionId ?? int.MaxValue, priority, callback);
     }
 }
Exemple #3
0
        internal static void Eventloader_GetBinder(BotBitsClient client, Type type, MethodInfo callback)
        {
            if (!Enabled)
            {
                return;
            }

            var assembly    = callback.DeclaringType?.Assembly;
            var extentionId = ExtensionServices.GetExtensionId(client, assembly);

            CheckBind(client, type, extentionId.HasValue, _loaderIgnore);
        }