public JanusProtocolDispatcher(IServiceProvider serviceProvider) { _serviceProvider = serviceProvider; _pageBuilder = new HtmlPageBuilder(serviceProvider); _xmlPageBuilder = new XmlPageBuilder(serviceProvider, _pageBuilder); var methods = GetType().GetMethods( BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static); foreach (var mi in methods) { var attribute = Attribute.GetCustomAttribute(mi, typeof(JanusProtocolEventHandlerAttribute)) as JanusProtocolEventHandlerAttribute; if (attribute != null) { _handlers.Add(attribute.Id, (JanusProtocolEventHandler)Delegate.CreateDelegate(typeof(JanusProtocolEventHandler), this, mi.Name)); } } }
public JanusProtocolDispatcher(IServiceProvider serviceProvider) { _serviceProvider = serviceProvider; _pageBuilder = new HtmlPageBuilder(serviceProvider); _xmlPageBuilder = new XmlPageBuilder(serviceProvider, _pageBuilder); var methods = GetType().GetMethods( BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static); foreach (var mi in methods) { var attribute = Attribute.GetCustomAttribute(mi, typeof(JanusProtocolEventHandlerAttribute)) as JanusProtocolEventHandlerAttribute; if (attribute != null) _handlers.Add(attribute.Id, (JanusProtocolEventHandler)Delegate.CreateDelegate(typeof(JanusProtocolEventHandler), this, mi.Name)); } }