/// <summary>
        /// Returnes all about's in channel.
        /// </summary>
        /// <returns></returns>
        internal RdfAboutCollection GetAbouts()
        {
            RdfAboutCollection rac = new RdfAboutCollection();

            rac.Add(this.GetAbout());
            return(rac);
        }
        /// <summary>
        /// Returnes all about's in channel.
        /// </summary>
        /// <returns></returns>
        internal RdfAboutCollection GetAbouts()
        {
            RdfAboutCollection rac = new RdfAboutCollection();

            foreach (RdfItem item in this)
            {
                rac.Add(item.GetAbouts());
            }
            return(rac);
        }
Ejemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        private RdfAboutCollection GetAbouts()
        {
            RdfAboutCollection rac = new RdfAboutCollection();

            if (this.Channel != null)
            {
                rac.Add(this.Channel.GetAbouts());
            }
            if (this.Items != null)
            {
                rac.Add(this.Items.GetAbouts());
            }
            if (this.Image != null)
            {
                rac.Add(this.Image.GetAbouts());
            }
            if (this.TextInput != null)
            {
                rac.Add(this.TextInput.GetAbouts());
            }

            return(rac);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Validates that the object model has the elements it needs
        /// to produce an RDF XML of the desired version.
        /// </summary>
        /// <param name="version"></param>
        public bool Validate(RdfVersion version, bool validateContent)
        {
            if (version == RdfVersion.RDF_1_0)
            {
                //
                // Check for required elements.
                //
                if (this.Channel == null)
                {
                    string msg = string.Format(Rdf.RDF_ERRORMESSAGE_VALIDATION_REQUIRED_FIELD_NULL, RDF_ELEMENT_CHANNEL);
                    throw new SyndicationValidationException(msg);
                }
                if (this.Items == null)
                {
                    string msg = string.Format(Rdf.RDF_ERRORMESSAGE_VALIDATION_REQUIRED_FIELD_NULL, "Items");
                    throw new SyndicationValidationException(msg);
                }

                RdfAboutCollection rac = GetAbouts();

                //
                // Ask each item to validate itself.
                //
                if (this.Channel != null)
                {
                    RdfAboutCollection racItems = new RdfAboutCollection();
                    if (this.Items != null)
                    {
                        racItems.Add(this.Items.GetAbouts());
                    }
                    string textInputAbout = (this.TextInput != null) ? this.TextInput.GetAbout() : null;
                    string imageAbout     = (this.Image != null) ? this.Image.GetAbout() : null;
                    string textinputAbout = (this.TextInput != null) ? this.TextInput.GetAbout() : null;
                    this.Channel.Validate(version, validateContent, rac, racItems, textInputAbout, imageAbout, textinputAbout);
                }
                if (this.Image != null)
                {
                    this.Image.Validate(version, validateContent, rac);
                }
                if (this.Items != null)
                {
                    this.Items.Validate(version, validateContent, rac);
                }
                if (this.TextInput != null)
                {
                    this.TextInput.Validate(version, validateContent, rac);
                }
            }
            return(true);
        }