예제 #1
0
        /// <summary>Adds a specified category to this collection.</summary>
        /// <param name="categoryName">Name of the category.</param>
        /// <param name="categoryDescription">Description of the category.</param>
        /// <param name="categoryDateFrom">From date of the category.</param>
        /// <param name="categoryDateTo">To date of the category.</param>
        /// <param name="categoryPhoto">Photos of the category.</param>
        /// <returns>The zero-based index of the added item.</returns>
        private int Add(string categoryName, string categoryDescription, string categoryDateFrom, string categoryDateTo, RssPhotoAlbumCategoryPhoto categoryPhoto)
        {
            var categoryDataRange = new RssModuleItemCollection();

            categoryDataRange.Add(new RssModuleItem("from", true, RssDefault.Check(categoryDateFrom)));
            categoryDataRange.Add(new RssModuleItem("to", true, RssDefault.Check(categoryDateTo)));

            base.Add(new RssModuleItem("categoryName", true, RssDefault.Check(categoryName)));
            base.Add(new RssModuleItem("categoryDescription", true, RssDefault.Check(categoryDescription)));
            base.Add(new RssModuleItem("categoryDateRange", true, "", categoryDataRange));
            base.Add(new RssModuleItem("categoryPhoto", true, "", categoryPhoto));

            return(-1);
        }
예제 #2
0
        /// <summary>Adds a specified category to this collection.</summary>
        /// <param name="categoryName">Name of the category.</param>
        /// <param name="categoryDescription">Description of the category.</param>
        /// <param name="categoryDateFrom">From date of the category.</param>
        /// <param name="categoryDateTo">To date of the category.</param>
        /// <param name="categoryPhotos">Photos of the category.</param>
        /// <returns>The zero-based index of the added item.</returns>
        private int Add(string categoryName, string categoryDescription, DateTime categoryDateFrom, DateTime categoryDateTo, RssPhotoAlbumCategoryPhotos categoryPhotos)
        {
            var categoryDataRange = new RssModuleItemCollection();

            categoryDataRange.Add(new RssModuleItem("from", true, RssDefault.Check(categoryDateFrom.ToUniversalTime().ToString("r"))));
            categoryDataRange.Add(new RssModuleItem("to", true, RssDefault.Check(categoryDateTo.ToUniversalTime().ToString("r"))));

            base.Add(new RssModuleItem("categoryName", true, RssDefault.Check(categoryName)));
            base.Add(new RssModuleItem("categoryDescription", true, RssDefault.Check(categoryDescription)));
            base.Add(new RssModuleItem("categoryDateRange", true, "", categoryDataRange));
            foreach (RssPhotoAlbumCategoryPhoto categoryPhoto in categoryPhotos)
            {
                base.Add(new RssModuleItem("categoryPhoto", true, "", categoryPhoto));
            }

            return(-1);
        }
예제 #3
0
        /// <summary>Initialize a new instance of the </summary>
        /// <param name="license">
        ///		If present as a sub-element of channel, indicates that the content of the RSS file is available under a license, indicated by a URL, which is the value of the license element. A list of some licenses that may be used in this context is on the Creative Commons website on this page, however the license element may point to licenses not authored by Creative Commons.
        ///		You may also use the license element as a sub-element of item. When used this way it applies only to the content of that item. If an item has a license, and the channel does too, the license on the item applies, i.e. the inner license overrides the outer one.
        ///		Multiple license elements are allowed, in either context, indicating that the content is available under multiple licenses.
        ///		<remarks>"http://www.creativecommons.org/licenses/"</remarks>
        ///	</param>
        /// <param name="isChannelSubElement">If present as a sub-element of channel then true, otherwise false</param>
        public RssCreativeCommons(Uri license, bool isChannelSubElement)
        {
            NamespacePrefix = "creativeCommons";
            NamespaceURL    = new Uri("http://backend.userland.com/creativeCommonsRssModule");

            if (isChannelSubElement)
            {
                ChannelExtensions.Add(new RssModuleItem("license", true, RssDefault.Check(license.ToString())));
            }
            else
            {
                var rssItems = new RssModuleItemCollection();

                rssItems.Add(new RssModuleItem("license", true, RssDefault.Check(license.ToString())));

                ItemExtensions.Add(rssItems);
            }
        }