Exemplo n.º 1
0
        /// <summary>
        /// Creates a Pipeline based on the data in the configuration file.
        /// </summary>
        /// <typeparam name="T">The type of the data the pipeline will handle.</typeparam>
        /// <param name="sectionName">The name of the configuration section containing the configuration data.</param>
        /// <returns>A Pipeline that handles the specified type.</returns>
        public static PipelineManager <T> CreateFromConfiguration <T>(string sectionName)
        {
            FilterChain <T> processors           = new FilterChain <T>();
            PipelineConfigurationSection section = (PipelineConfigurationSection)System.Configuration.ConfigurationManager.GetSection(sectionName);

            if (section != null)
            {
                foreach (PipelineHandlerConfigurationElement element in section.Processors)
                {
                    processors.Add((System.Web.IHttpHandler)ObjectFactory.Create(element.HandlerType));
                }
            }
            return(new PipelineManager <T>(processors));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Creates an instance of the class using the specified ISteps.
 /// </summary>
 /// <param name="pipeline">The collection of ISteps to use for the pipeline.</param>
 public PipelineManager(FilterChain <T> filters)
 {
     this.filters = filters;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Creates and instance of the class.
 /// </summary>
 public PipelineManager()
 {
     filters = new FilterChain <T>();
 }