Ejemplo 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> CreateAuthFromConfiguration <T>(string sectionName)
        {
            AuthChain <T> processors             = new AuthChain <T>();
            PipelineConfigurationSection section = (PipelineConfigurationSection)System.Configuration.ConfigurationManager.GetSection(sectionName);

            if (section != null)
            {
                foreach (PipelineHandlerConfigurationElement element in section.Processors)
                {
                    processors.Add((RestNet.IRestNetAuth)ObjectFactory.Create(element.HandlerType));
                }
            }
            return(new PipelineManager <T>(processors));
        }
Ejemplo n.º 2
0
 public PipelineManager(AuthChain <T> auths)
 {
     this.auths = auths;
 }