Exemplo n.º 1
0
        public void InstallHandlers(Assembly assembly)
        {
            var handlers = assembly.GetTypes()
                           .Where(t => t.IsSubclassOf(typeof(DiscordHandlerBase)));

            foreach (var handler in handlers)
            {
                if (DependencyFactory.TryConstruct(handler, out object obj))
                {
                    Handlers.Add((DiscordHandlerBase)obj);
                }
            }
        }