Beispiel #1
0
        /// <summary>
        ///  helper method to add extensions to the evententry
        /// </summary>
        private void addYouTubeEntryExtensions() {
            MediaGroup mg = new MediaGroup();
            this.AddExtension(mg);

            GeoRssExtensions.AddExtension(this);
            AppControl app = new AppControl();
            app.ProtocolMajor = this.ProtocolMajor;
            app.ProtocolMinor = this.ProtocolMinor;

            AppControl acf = FindExtensionFactory(app.XmlName, app.XmlNameSpace) as AppControl;
            if (acf == null) {
                // create a default appControl element
                acf = new AppControl();
                this.AddExtension(acf);
            }

            // add the youtube state element
            acf.ExtensionFactories.Add(new State());

            // things from the gd namespce
            this.AddExtension(new Comments());
            this.AddExtension(new Rating());

            // add youtube namespace elements
            this.AddExtension(new Episode());
            this.AddExtension(new Statistics());
            this.AddExtension(new Location());
            this.AddExtension(new Recorded());
            this.AddExtension(new Uploaded());
            this.AddExtension(new YtRating());
            this.AddExtension(new YtAccessControl());
        }
        ///////////////////////////////////////////////////////////////////////
        /// <summary>Creates a new entry</summary>
        ///////////////////////////////////////////////////////////////////////
        public GBaseEntry() : base()
        {
            attributes = new GBaseAttributes(ExtensionElements);
            itemTypeDefinition = new ItemTypeDefinition(ExtensionElements);

            // now add appcontrol
            AppControl app = new AppControl();

            AppControl acf = FindExtensionFactory(app.XmlName, app.XmlNameSpace) as AppControl;
            if (acf == null)
            {
                // create a default appControl element
                acf = new AppControl();
                this.AddExtension(acf);
            }
            // add the publishing priority element factory
            acf.ExtensionFactories.Add(new PublishingPriority());

        }