/// <summary>
        /// Modifies the <see cref="ISyndicationResource"/> to match the data source.
        /// </summary>
        /// <param name="resource">The Atom Publishing Protocol <see cref="ISyndicationResource"/> to be filled.</param>
        /// <param name="resourceMetadata">A <see cref="SyndicationResourceMetadata"/> object that represents the meta-data describing the <paramref name="resource"/>.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="resource"/> is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="ArgumentNullException">The <paramref name="resourceMetadata"/> is a null reference (Nothing in Visual Basic).</exception>
        private void FillAtomPublishingResource(ISyndicationResource resource, SyndicationResourceMetadata resourceMetadata)
        {
            //------------------------------------------------------------
            //	Validate parameter
            //------------------------------------------------------------
            Guard.ArgumentNotNull(resource, "resource");
            Guard.ArgumentNotNull(resourceMetadata, "resourceMetadata");

            //------------------------------------------------------------
            //	Fill syndication resource using appropriate data adapter
            //------------------------------------------------------------
            AtomCategoryDocument categoryDocument = resource as AtomCategoryDocument;
            AtomServiceDocument  serviceDocument  = resource as AtomServiceDocument;

            if (resourceMetadata.Version == new Version("1.0"))
            {
                AtomPublishing10SyndicationResourceAdapter atomPublishing10Adapter = new AtomPublishing10SyndicationResourceAdapter(this.Navigator, this.Settings);
                if (categoryDocument != null)
                {
                    atomPublishing10Adapter.Fill(categoryDocument);
                }
                else if (serviceDocument != null)
                {
                    atomPublishing10Adapter.Fill(serviceDocument);
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Modifies the <see cref="ISyndicationResource"/> to match the data source.
        /// </summary>
        /// <param name="resource">The Atom Publishing Protocol <see cref="ISyndicationResource"/> to be filled.</param>
        /// <param name="resourceMetadata">A <see cref="SyndicationResourceMetadata"/> object that represents the meta-data describing the <paramref name="resource"/>.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="resource"/> is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="ArgumentNullException">The <paramref name="resourceMetadata"/> is a null reference (Nothing in Visual Basic).</exception>
        private void FillAtomPublishingResource(ISyndicationResource resource, SyndicationResourceMetadata resourceMetadata)
        {
            //------------------------------------------------------------
            //	Validate parameter
            //------------------------------------------------------------
            Guard.ArgumentNotNull(resource, "resource");
            Guard.ArgumentNotNull(resourceMetadata, "resourceMetadata");

            //------------------------------------------------------------
            //	Fill syndication resource using appropriate data adapter
            //------------------------------------------------------------
            AtomCategoryDocument categoryDocument   = resource as AtomCategoryDocument;
            AtomServiceDocument serviceDocument     = resource as AtomServiceDocument;

            if (resourceMetadata.Version == new Version("1.0"))
            {
                AtomPublishing10SyndicationResourceAdapter atomPublishing10Adapter  = new AtomPublishing10SyndicationResourceAdapter(this.Navigator, this.Settings);
                if (categoryDocument != null)
                {
                    atomPublishing10Adapter.Fill(categoryDocument);
                }
                else if (serviceDocument != null)
                {
                    atomPublishing10Adapter.Fill(serviceDocument);
                }
            }
        }