BlogEngine.Core.SyndicationGenerator.SyndicationGenerator C# (CSharp) Méthode

SyndicationGenerator() public méthode

Initializes a new instance of the SyndicationGenerator class using the supplied BlogSettings and collection of Category objects.
public SyndicationGenerator ( BlogSettings settings, List categories ) : System
settings BlogSettings /// The to use when generating syndication results. ///
categories List /// A collection of objects used to categorize the web log content. ///
Résultat System
        public SyndicationGenerator(BlogSettings settings, List<Category> categories)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            if (categories == null)
            {
                throw new ArgumentNullException("categories");
            }

            // ------------------------------------------------------------
            // Initialize class state
            // ------------------------------------------------------------
            this.Settings = settings;

            if (categories.Count <= 0)
            {
                return;
            }

            var values = new Category[categories.Count];
            categories.CopyTo(values);

            foreach (var category in values)
            {
                this.Categories.Add(category);
            }
        }