/// <summary> /// Loads the configuration. /// </summary> /// <param name="xmlNodeConfig">The XML node config.</param> internal virtual void LoadConfiguration(XmlNode xmlNodeConfig) { // The constructor for each of the subscribers ConstructorInfo requestSubscriberConstructor = null; // Use reflection to store the constructor of the class Type t = null; // Create the request subscribers foreach (XmlNode xmlNodeSubscriber in xmlNodeConfig.SelectNodes("Subscriber")) { // Get the type t = Type.GetType(xmlNodeSubscriber.Attributes["Type"].Value, true); // Get public instance constructor that takes a RequestProcessor requestSubscriberConstructor = t.GetConstructor(new Type[] { typeof(RequestProcessor) }); // Create an instance of the specific subscriber and pass this processor RequestSubscriber reqSubscriber = (RequestSubscriber)requestSubscriberConstructor.Invoke(new Object[] { this }); // Get the request subscriber to load its configuration reqSubscriber.LoadConfiguration(xmlNodeSubscriber); // Add the request subscriber to our subscriber list requestSubscribers.Add(reqSubscriber); } }
/// <summary> /// Initializes a new instance of the <see cref="T:RequestFilter"/> class. /// </summary> /// <param name="requestSubscriber">The request subscriber.</param> public RequestFilter(RequestSubscriber requestSubscriber) { }