Logo Search packages:      
Sourcecode: gdata-sharp version File versions  Download package

youtubeextensions.cs

/* Copyright (c) 2006 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
*/

using System;
using System.Xml;
using Google.GData.Client;
using Google.GData.Extensions;
using Google.GData.Extensions.MediaRss;
using System.Globalization;
using System.IO;

namespace Google.GData.YouTube {


    /// <summary>
    /// short table to hold the namespace and the prefix
    /// </summary>
00030     public class YouTubeNameTable 
    {
        /// <summary>static string to specify the YouTube namespace supported</summary>
00033         public const string NSYouTube = "http://gdata.youtube.com/schemas/2007"; 
        /// <summary>static string to specify the Google YouTube prefix used</summary>
00035         public const string ytPrefix = "yt"; 
        /// <summary>static string for the ratings relationship</summary>
00037         public const string RatingsRelationship = NSYouTube + "#video.ratings"; 
        /// <summary>static string for the in reply to  relationship</summary>
00039         public const string ReplyToRelationship = NSYouTube + "#in-reply-to"; 

        /// <summary>string for the video kind category</summary>
00042         public const string KIND_VIDEO = NSYouTube + "#video";
        /// <summary>string for the complaint kind category</summary>
00044         public const string KIND_COMPLAINT = NSYouTube + "#complaint";
        /// <summary>string for the comment kind category</summary>
00046         public const string KIND_COMMENT = NSYouTube + "#comment";
        /// <summary>string for the playlistLink kind category</summary>
00048         public const string KIND_PLAYLIST_LINK = NSYouTube + "#playlistLink";
        /// <summary>string for the subscription kind category</summary>
00050         public const string KIND_SUBSCRIPTION = NSYouTube + "#subscription";
        /// <summary>string for the friend kind category</summary>
00052         public const string KIND_FRIEND = NSYouTube + "#friend";
        /// <summary>string for the rating kind category</summary>
00054         public const string KIND_RATING = NSYouTube + "#rating";
        /// <summary>string for the userProfile kind category</summary>
00056         public const string KIND_USER_PROFILE = NSYouTube + "#userProfile";        
        /// <summary>string for the playlist kind category</summary>
00058         public const string KIND_PLAYLIST = NSYouTube + "#playlist";
        /// <summary>string for the videoMessage kind category</summary>
00060         public const string KIND_VIDEO_MESSAGE = NSYouTube + "#videoMessage";

        /// <summary>
        /// The schema used for friends entries
        /// </summary>
00065         public const string FriendsCategorySchema = NSYouTube + "/contact.cat";

        /// <summary>
        /// The schema used for subscription entries
        /// </summary>
00070         public const string SubscriptionCategorySchema = NSYouTube + "/subscriptiontypes.cat";

        /// <summary>
        /// The schema used for complaint entries
        /// </summary>
00075         public const string ComplaintCategorySchema = NSYouTube + "/complaint-reasons.cat";

         /// <summary>
        /// The schema used for user events  entries
        /// </summary>
00080         public const string EventsCategorySchema = NSYouTube + "/userevents.cat";

        /// <summary>
        /// string for the user rated category term
        /// </summary>
00085         public const string VideoRatedCategory = "video_rated";

        /// <summary>
        /// string for the user shared category term
        /// </summary>
00090         public const string VideoSharedCategory = "video_shared";

        /// <summary>
        /// string for the user uploaded category term
        /// </summary>
00095         public const string VideoUploadedCategory = "video_uploaded";

        /// <summary>
        /// string for the user favorited category term
        /// </summary>
00100         public const string VideoFavoritedCategory = "video_favorited";
        /// <summary>
        /// string for the user commented category term
        /// </summary>
00104         public const string VideoCommentedCategory = "video_commented";
        /// <summary>
        /// string for the user friend added category term
        /// </summary>
00108         public const string FriendAddedCategory = "friend_added";
        /// <summary>
        /// string for the user subscriptoin added category term
        /// </summary>
00112         public const string UserSubscriptionAddedCategory = "user_subscription_added";


        /// <summary>
        /// age element string
        /// </summary>
00118         public const string Age = "age";
        /// <summary>
        /// books element string
        /// </summary>
00122         public const string Books = "books";
        /// <summary>
        /// The schema used for categories
        /// </summary>
00126         public const string CategorySchema = NSYouTube + "/categories.cat";
        /// <summary>
        /// Company element string
        /// </summary>
00130         public const string Company = "company";
        /// <summary>
        /// content element string
        /// </summary>
00134         public const string Content = "content";
        /// <summary>
        /// Description element string
        /// </summary>
00138         public const string Description = "description";
        /// <summary>
        /// The schema used for developer tags
        /// </summary>
00142         public const string DeveloperTagSchema = NSYouTube + "/developertags.cat";
        /// <summary>
        /// Duration element string
        /// </summary>
00146         public const string Duration = "duration";
        /// <summary>
        /// FirstName element string
        /// </summary>
00150         public const string FirstName = "firstName";
        /// <summary>
        /// Gender element string
        /// </summary>
00154         public const string Gender = "gender";
        /// <summary>
        /// Hobbies element string
        /// </summary>
00158         public const string Hobbies = "hobbies";
        /// <summary>
        /// HomeTown element string
        /// </summary>
00162         public const string HomeTown = "hometown";
        /// <summary>
        /// The schema used for keywords
        /// </summary>
00166         public const string KeywordSchema = NSYouTube + "/keywords.cat";
        /// <summary>
        /// LastName element string
        /// </summary>
00170         public const string LastName = "lastName";
        /// <summary>
        /// Location element string
        /// </summary>
00174         public const string Location = "location";
        /// <summary>
        /// Movies element string
        /// </summary>
00178         public const string Movies = "movies";
        /// <summary>
        /// Music element string
        /// </summary>
00182         public const string Music = "music";
        /// <summary>
        /// NoEmbed element string
        /// </summary>
00186         public const string NoEmbed = "noembed";
        /// <summary>
        /// Occupation element string
        /// </summary>
00190         public const string Occupation = "occupation";
        /// <summary>
        /// Position element string
        /// </summary>
00194         public const string Position = "position";
        /// <summary>
        /// Private element string
        /// </summary>
00198         public const string Private = "private";
        /// <summary>
        /// QueryString element string
        /// </summary>
00202         public const string QueryString = "queryString";
        /// <summary>
        /// Racy element string
        /// </summary>
00206         public const string Racy = "racy";
        /// <summary>
        /// Recorded element string
        /// </summary>
00210         public const string Recorded = "recorded";
        /// <summary>
        /// The related videos URI in the link collection
        /// </summary>
00214         public const string RelatedVideo = NSYouTube + "#video.related";
        /// <summary>
        /// Relationship element string
        /// </summary>
00218         public const string Relationship = "relationship";
        /// <summary>
        /// The video response URI in the link collection
        /// </summary>
00222         public const string ResponseVideo = NSYouTube + "#video.responses";
        /// <summary>
        /// The video complaint URI in the link collection
        /// </summary>
00226         public const string Complaint = NSYouTube + "#video.complaints";
        /// <summary>
        /// School element string
        /// </summary>
00230         public const string School = "school";
        /// <summary>
        /// State element string
        /// </summary>
00234         public const string State = "state";
        /// <summary>
        /// Statistics element string
        /// </summary>
00238         public const string Statistics = "statistics";
        /// <summary>
        /// Status element string
        /// </summary>
00242         public const string Status = "status";
        /// <summary>
        /// UserName element string
        /// </summary>
00246         public const string UserName = "username";
        /// <summary>
        /// counthint element string for playlist feeds
        /// </summary>
00250         public const string CountHint = "countHint";
        /// <summary>
        /// videoid element string for playlist feeds
        /// </summary>
00254         public const string VideoID = "videoid";
        /// <summary>
        /// uploaded element string for playlist feeds
        /// </summary>
00258         public const string Uploaded = "uploaded";

        /// <summary>
        /// title for a playlist
        /// </summary>
00263         public const string PlaylistTitle = "playlistTitle";

        /// <summary>
        /// id for a playlist
        /// </summary>
00268         public const string PlaylistId = "playlistId";

    }


    /// <summary>
    ///  this Category entry will be returned for the list of official YouTubeCategories, 
    /// using the <seealso cref="YouTubeQuery.GetYouTubeCategories"/> method
    /// </summary>
00277     public class YouTubeCategory : Google.GData.Client.AtomCategory
    {

        /// <summary>
        /// Indicates that new videos may be assigned to that category. New videos 
        /// cannot be assigned to categories that are not marked as assignable
        /// </summary>
        /// 
        public bool Assignable
00286         {
            get
            {
                return (this.FindExtension("assignable", YouTubeNameTable.NSYouTube) != null); 
            }
        }

        /// <summary>
        /// The presence of the &lt;yt:browsable&gt; tag indicates that the corresponding 
        /// category is browsable on YouTube in one or more countries. The tag's regions 
        /// attribute contains a space-delimited list of two-letter regionIDs that 
        /// identifies the particular countries where the category is browsable. 
        /// </summary>
        public string Browsable
00300         {
            get
            {
                XmlExtension x = this.FindExtension("browsable", YouTubeNameTable.NSYouTube) as XmlExtension;
                if (x != null && x.Node != null)
                {
                    return x.Node.Attributes["regions"].Value;
                }
                return null; 
            }
        }

        /// <summary>
        /// Categories that are neither assignable or browsable are deprecated and are identified as such
        /// </summary>
        public bool Deprecated
00316         {
            get
            {
                return (this.FindExtension("deprecated", YouTubeNameTable.NSYouTube) != null); 
            }
        }
        


    }
   

    /// <summary>
    /// YouTube specific MediaGroup element. It adds Duration and Private 
    /// subelements as well as using a different version of MediaCredit
    /// </summary>
    /// <returns></returns>
00333     public class MediaGroup : Google.GData.Extensions.MediaRss.MediaGroup
    {
        private ExtensionCollection<MediaContent> contents;
      
00337         public MediaGroup() :
            base()
        {
            this.ExtensionFactories.Add(new Duration());
            this.ExtensionFactories.Add(new Private());
            this.ExtensionFactories.Add(new VideoId());

            // replace the media group default media credit with a new one. 
            MediaCredit c = new Google.GData.YouTube.MediaCredit();
            this.ReplaceFactory(c.XmlName, c.XmlNameSpace, c);
            // replace the media group default media content with a new one. 
            MediaContent m = new Google.GData.YouTube.MediaContent();
            this.ReplaceFactory(m.XmlName, m.XmlNameSpace, m);
        }


        /// <summary>
        ///  property accessor for the Contents Collection 
        /// </summary>
        public ExtensionCollection<MediaContent> Contents
00357         {
            get
            {
                if (this.contents == null)
                {
                    this.contents = new ExtensionCollection<MediaContent>(this);
                }
                return this.contents;
            }
        }

        /// <summary>
        /// returns the media:credit element
        /// </summary>
        public new MediaCredit Credit
00372         {
            get
            {
                return FindExtension(MediaRssNameTable.MediaRssCredit,
                                     MediaRssNameTable.NSMediaRss) as Google.GData.YouTube.MediaCredit;
            }
            set
            {
                ReplaceExtension(MediaRssNameTable.MediaRssCredit,
                                MediaRssNameTable.NSMediaRss,
                                value);
            }
        }

        /// <summary>
        /// returns the yt:duration element
        /// </summary>
        public Duration Duration
00390         {
            get
            {
                return FindExtension(YouTubeNameTable.Duration,
                                     YouTubeNameTable.NSYouTube) as Duration;
            }
            set
            {
                ReplaceExtension(YouTubeNameTable.Duration,
                                YouTubeNameTable.NSYouTube,
                                value);
            }
        }

         /// <summary>
        /// returns the yt:duration element
        /// </summary>
        public Private Private
00408         {
            get
            {
                return FindExtension(YouTubeNameTable.Private,
                                     YouTubeNameTable.NSYouTube) as Private;
            }
            set
            {
                ReplaceExtension(YouTubeNameTable.Private,
                                YouTubeNameTable.NSYouTube,
                                value);
            }
        }


        /// <summary>
        ///  property accessor for the VideoID, if applicable
        /// </summary>
        public VideoId VideoId
00427         {
            get
            {
                return FindExtension(YouTubeNameTable.VideoID,
                                     YouTubeNameTable.NSYouTube) as VideoId;
            }
            set
            {
                ReplaceExtension(YouTubeNameTable.VideoID,
                                YouTubeNameTable.NSYouTube,
                                value);
            }
        }



    }

    public class MediaCredit : Google.GData.Extensions.MediaRss.MediaCredit
    {

            /// <summary>
        /// default constructor for media:credit
        /// </summary>
        public MediaCredit()
        : base()
        {
            this.AttributeNamespaces.Add("type", YouTubeNameTable.NSYouTube);
            this.Attributes.Add("type", null);
        }

        /// <summary>
        ///  returns the type of the credit element
        /// </summary>
        /// <returns></returns>
        public string Type
        {
            get
            {
                return this.Attributes["type"] as string;
            }
            set
            {
                this.Attributes["type"] = value;
            }
        }

    }

    public class MediaContent : Google.GData.Extensions.MediaRss.MediaContent
    {

            /// <summary>
        /// default constructor for media:credit
        /// </summary>
        public MediaContent()
        : base()
        {
            this.AttributeNamespaces.Add("format", YouTubeNameTable.NSYouTube);
            this.Attributes.Add("format", null);
        }

          /// <summary>
        ///  returns the type of the credit element
        /// </summary>
        /// <returns></returns>
        public string Format
        {
            get
            {
                return this.Attributes["format"] as string;
            }
            set
            {
                this.Attributes["format"] = value;
            }
        }

    }



    /// <summary>
    /// id schema extension describing an ID.
    /// </summary>
00512     public class Age : SimpleElement
    {
        /// <summary>
        /// default constructor 
        /// </summary>
00517         public Age()
        : base(YouTubeNameTable.Age, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {}

        /// <summary>
        /// default constructor with an initial value as a string 
        /// </summary>
00524         public Age(string initValue)
        : base(YouTubeNameTable.Age, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {}
    }

    /// <summary>
    /// Books schema extension describing a YouTube Books
    /// </summary>
00532     public class Books : SimpleElement
    {
        /// <summary>
        /// default constructor
        /// </summary>
00537         public Books()
        : base(YouTubeNameTable.Books, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {}
        /// <summary>
        /// constructor with an init value
        /// </summary>
        /// <param name="initValue"></param>
00544         public Books(string initValue)
        : base(YouTubeNameTable.Books, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {}
    }

    /// <summary>
    /// Company schema extension describing a YouTube Company
    /// </summary>
00552     public class Company : SimpleElement
    {
        /// <summary>
        /// default constructor
        /// </summary>
00557         public Company()
        : base(YouTubeNameTable.Company, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {}
        /// <summary>
        /// constructor taking the initial value
        /// </summary>
        /// <param name="initValue"></param>
00564         public Company(string initValue)
        : base(YouTubeNameTable.Company, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {}
    }

    /// <summary>
    /// content schema extension describing a YouTube complaint
    /// </summary>
00572     public class Content : SimpleElement
    {
        /// <summary>
        /// default constructor
        /// </summary>
00577         public Content()
            : base(YouTubeNameTable.Content, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        { }
        /// <summary>
        /// constructor taking the initial value
        /// </summary>
        /// <param name="initValue"></param>
00584         public Content(string initValue)
            : base(YouTubeNameTable.Content, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        { }
    }

    /// <summary>
    /// Description schema extension describing a YouTube Description
    /// </summary>
00592     public class Description : SimpleElement
    {
        /// <summary>
        /// default constructor
        /// </summary>
00597         public Description()
        : base(YouTubeNameTable.Description, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {}
        /// <summary>
        /// constructor taking the initial value
        /// </summary>
        /// <param name="initValue"></param>
00604         public Description(string initValue)
        : base(YouTubeNameTable.Description, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {}
    }

    /// <summary>
    /// Duration schema extension describing a YouTube Duration
    /// </summary>
00612     public class Duration : SimpleElement
    {
         /// <summary>the seconds xml attribute </summary>
00615         public const string AttributeSeconds = "seconds";

        /// <summary>
        /// default constructor
        /// </summary>
00620         public Duration()
        : base(YouTubeNameTable.Duration, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {
            this.Attributes.Add(AttributeSeconds, null);
        }

        /// <summary>
        /// constructor taking the initial value
        /// </summary>
        /// <param name="initValue"></param>
00630         public Duration(string initValue)
        : base(YouTubeNameTable.Duration, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {
            this.Attributes.Add(AttributeSeconds, null);
        }

       //////////////////////////////////////////////////////////////////////
       /// <summary>returns you the seconds attribute</summary>
       /// <returns> </returns>
       //////////////////////////////////////////////////////////////////////
       public string Seconds
00641        {
           get
           {
               return this.Attributes[AttributeSeconds] as string;
           }
           set
           {
               this.Attributes[AttributeSeconds] = value;
           }
       }
    }

    /// <summary>
    /// FirstName schema extension describing a YouTube FirstName
    /// </summary>
00656     public class FirstName : SimpleElement
    {
        /// <summary>
        /// default constructor
        /// </summary>
00661         public FirstName()
        : base(YouTubeNameTable.FirstName, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {}
        /// <summary>
        /// constructor taking the initial value
        /// </summary>
        /// <param name="initValue"></param>
00668         public FirstName(string initValue)
        : base(YouTubeNameTable.FirstName, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {}
    }

    /// <summary>
    /// Gender schema extension describing a YouTube Gender
    /// </summary>
00676     public class Gender : SimpleElement
    {
        /// <summary>
        /// default constructor
        /// </summary>
00681         public Gender()
        : base(YouTubeNameTable.Gender, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {}
        /// <summary>
        /// constructor taking the initial value
        /// </summary>
        /// <param name="initValue"></param>
00688         public Gender(string initValue)
        : base(YouTubeNameTable.Gender, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {}
    }

    /// <summary>
    /// Hobbies schema extension describing a YouTube Hobbies
    /// </summary>
00696     public class Hobbies : SimpleElement
    {
        /// <summary>
        /// default constructor
        /// </summary>
00701         public Hobbies()
        : base(YouTubeNameTable.Hobbies, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {}
        /// <summary>
        /// constructor taking the initial value
        /// </summary>
        /// <param name="initValue"></param>
00708         public Hobbies(string initValue)
        : base(YouTubeNameTable.Hobbies, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {}
    }

    /// <summary>
    /// HomeTown schema extension describing a YouTube HomeTown
    /// </summary>
00716     public class HomeTown : SimpleElement
    {
        /// <summary>
        /// default constructor
        /// </summary>
00721         public HomeTown()
        : base(YouTubeNameTable.HomeTown, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {}
        /// <summary>
        /// constructor taking the initial value
        /// </summary>
        /// <param name="initValue"></param>
00728         public HomeTown(string initValue)
        : base(YouTubeNameTable.HomeTown, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {}
    }
    

    /// <summary>
    /// LastName schema extension describing a YouTube LastName
    /// </summary>
00737     public class LastName : SimpleElement
    {
        /// <summary>
        /// default constructor
        /// </summary>
00742         public LastName()
        : base(YouTubeNameTable.LastName, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {}
        /// <summary>
        /// constructor taking the initial value
        /// </summary>
        /// <param name="initValue"></param>
00749         public LastName(string initValue)
        : base(YouTubeNameTable.LastName, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {}
    }

    /// <summary>
    /// Location schema extension describing a YouTube Location
    /// </summary>
00757     public class Location : SimpleElement
    {
        /// <summary>
        /// default constructor
        /// </summary>
00762         public Location()
        : base(YouTubeNameTable.Location, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {}
        /// <summary>
        /// constructor taking the initial value
        /// </summary>
        /// <param name="initValue"></param>
00769         public Location(string initValue)
        : base(YouTubeNameTable.Location, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {}
    }

    /// <summary>
    /// Movies schema extension describing a YouTube Movies
    /// </summary>
00777     public class Movies : SimpleElement
    {
        /// <summary>
        /// default constructor
        /// </summary>
00782         public Movies()
        : base(YouTubeNameTable.Movies, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {}
        /// <summary>
        /// constructor taking the initial value
        /// </summary>
        /// <param name="initValue"></param>
00789         public Movies(string initValue)
        : base(YouTubeNameTable.Movies, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {}
    }

    /// <summary>
    /// Music schema extension describing a YouTube Music
    /// </summary>
00797     public class Music : SimpleElement
    {
        /// <summary>
        /// default constructor
        /// </summary>
00802         public Music()
        : base(YouTubeNameTable.Music, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {}
        /// <summary>
        /// constructor taking the initial value
        /// </summary>
        /// <param name="initValue"></param>
00809         public Music(string initValue)
        : base(YouTubeNameTable.Music, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {}
    }

    /// <summary>
    /// NoEmbed schema extension describing a YouTube NoEmbed
    /// </summary>
00817     public class NoEmbed : SimpleElement
    {
        /// <summary>
        /// default constructor
        /// </summary>
00822         public NoEmbed()
        : base(YouTubeNameTable.NoEmbed, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {}
        /// <summary>
        /// constructor taking the initial value
        /// </summary>
        /// <param name="initValue"></param>
00829         public NoEmbed(string initValue)
        : base(YouTubeNameTable.NoEmbed, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {}
    }

    /// <summary>
    /// Occupation schema extension describing a YouTube Occupation
    /// </summary>
00837     public class Occupation : SimpleElement
    {
        /// <summary>
        /// default constructor
        /// </summary>
00842         public Occupation()
        : base(YouTubeNameTable.Occupation, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {}
        /// <summary>
        /// constructor taking the initial value
        /// </summary>
        /// <param name="initValue"></param>
00849         public Occupation(string initValue)
        : base(YouTubeNameTable.Occupation, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {}
    }

    /// <summary>
    /// Position schema extension describing a YouTube Position
    /// </summary>
00857     public class Position : SimpleElement
    {
        /// <summary>
        /// default constructor
        /// </summary>
00862         public Position()
        : base(YouTubeNameTable.Position, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {}
        /// <summary>
        /// constructor taking the initial value
        /// </summary>
        /// <param name="initValue"></param>
00869         public Position(string initValue)
        : base(YouTubeNameTable.Position, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {}
    }

    /// <summary>
    /// Private schema extension describing a YouTube Private
    /// </summary>
00877     public class Private : SimpleElement
    {
        /// <summary>
        /// default constructor
        /// </summary>
00882         public Private()
        : base(YouTubeNameTable.Private, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {}
        /// <summary>
        /// constructor taking the initial value
        /// </summary>
        /// <param name="initValue"></param>
00889         public Private(string initValue)
        : base(YouTubeNameTable.Private, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {}
    }

    /// <summary>
    /// QueryString schema extension describing a YouTube QueryString
    /// </summary>
00897     public class QueryString : SimpleElement
    {
        /// <summary>
        /// default constructor
        /// </summary>
00902         public QueryString()
        : base(YouTubeNameTable.QueryString, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {}
        /// <summary>
        /// constructor taking the initial value
        /// </summary>
        /// <param name="initValue"></param>
00909         public QueryString(string initValue)
        : base(YouTubeNameTable.QueryString, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {}
    }

    /// <summary>
    /// Racy schema extension describing a YouTube Racy
    /// </summary>
    [Obsolete("replaced media:rating")] 
00918     public class Racy : SimpleElement
    {
        /// <summary>
        /// default constructor 
        /// </summary>
00923         public Racy()
        : base(YouTubeNameTable.Racy, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {}
        /// <summary>
        /// constructor taking the initial value
        /// </summary>
        /// <param name="initValue"></param>
00930         public Racy(string initValue)
        : base(YouTubeNameTable.Racy, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {}
    }

    /// <summary>
    /// Recorded schema extension describing a YouTube Recorded
    /// </summary>
00938     public class Recorded : SimpleElement
    {
        /// <summary>
        /// default constructor
        /// </summary>
00943         public Recorded()
        : base(YouTubeNameTable.Recorded, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {}
        /// <summary>
        /// constructor taking the initial value
        /// </summary>
        /// <param name="initValue"></param>
00950         public Recorded(string initValue)
        : base(YouTubeNameTable.Recorded, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {}
    }

    /// <summary>
    /// Relationship schema extension describing a YouTube Relationship
    /// </summary>
00958     public class Relationship : SimpleElement
    {
        /// <summary>
        /// default constructor
        /// </summary>
00963         public Relationship()
        : base(YouTubeNameTable.Relationship, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {}
        /// <summary>
        /// constructor taking the initial value
        /// </summary>
        /// <param name="initValue"></param>
00970         public Relationship(string initValue)
        : base(YouTubeNameTable.Relationship, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {}
    }

    /// <summary>
    /// Identifies the school that the user attended according to the information 
    /// in the user's public YouTube profile.
    /// </summary>
00979     public class School : SimpleElement
    {
        /// <summary>
        /// default constructor
        /// </summary>
00984         public School()
        : base(YouTubeNameTable.School, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {}
        /// <summary>
        /// constructor taking the initial value
        /// </summary>
        /// <param name="initValue"></param>
00991         public School(string initValue)
        : base(YouTubeNameTable.School, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {}
    }

    /// <summary>
    /// State schema extension describing a YouTube State, child of app:control
    /// The state tag contains information that describes the status of a video. 
    /// For videos that failed to upload or were rejected after the upload 
    /// process, the reasonCode attribute and the tag value provide 
    /// insight into the reason for the upload problem.
    /// </summary>
01003     public class State : SimpleElement
    {
        /// <summary>the name xml attribute </summary>
01006         public const string AttributeName = "name";
        /// <summary>the reasonCode xml attribute </summary>
01008         public const string AttributeReason = "reasonCode";
        /// <summary>the help xml attribute </summary>
01010         public const string AttributeHelp = "helpUrl";

        /// <summary>
        /// default constructor
        /// </summary>
01015         public State()
        : base(YouTubeNameTable.State, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {
            this.Attributes.Add(AttributeName, null);
            this.Attributes.Add(AttributeReason, null);
            this.Attributes.Add(AttributeHelp, null);
        }
        /// <summary>
        /// constructor taking the initial value
        /// </summary>
        /// <param name="initValue"></param>
01026         public State(string initValue)
        : base(YouTubeNameTable.State, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {
            this.Attributes.Add(AttributeName, null);
            this.Attributes.Add(AttributeReason, null);
            this.Attributes.Add(AttributeHelp, null);
        }

        //////////////////////////////////////////////////////////////////////
        /// <summary>The name attribute identifies the status of an unpublished video. 
        /// Valid values for this tag are processing, deleted, rejected and failed.</summary>
        /// <returns> </returns>
        //////////////////////////////////////////////////////////////////////
        public string Name
01040         {
            get
            {
                return this.Attributes[AttributeName] as string;
            }
            set
            {
                this.Attributes[AttributeName] = value;
            }
        }

        //////////////////////////////////////////////////////////////////////
        /// <summary>The reasonCode attribute provides information about why a video failed 
        /// to upload or was rejected after the uploading process. The yt:state tag will not 
        /// include a reasonCode attribute if the value of the name 
        /// attribute is processing. </summary>
        /// <returns> </returns>
        //////////////////////////////////////////////////////////////////////
        public string Reason
01059         {
            get
            {
                return this.Attributes[AttributeReason] as string;
            }
            set
            {
                this.Attributes[AttributeReason] = value;
            }
        }

        //////////////////////////////////////////////////////////////////////
        /// <summary>The helpUrl parameter contains a link to a YouTube Help 
        /// Center page that may help the developer or the video owner to 
        /// diagnose the reason that an upload failed or was rejected..</summary>
        /// <returns> </returns>
        //////////////////////////////////////////////////////////////////////
        public string Help
01077         {
            get
            {
                return this.Attributes[AttributeHelp] as string;
            }
            set
            {
                this.Attributes[AttributeHelp] = value;
            }
        }
    }

    /// <summary>
    /// The statistics tag provides statistics about a video or a user. 
    /// The statistics tag is not provided in a video entry if the value 
    /// of the viewCount attribute is 0.
    /// </summary>
01094     public class Statistics : SimpleElement
    {
        /// <summary>the viewCount xml attribute </summary>
01097         public const string AttributeViewCount = "viewCount";
        /// <summary>the videoWatchCount xml attribute </summary>
01099         public const string AttributeWatchCount = "videoWatchCount";
        /// <summary>the subscriberCount xml attribute </summary>
01101         public const string AttributeSubscriberCount = "subscriberCount";
        /// <summary>the lastWebAccess xml attribute </summary>
01103         public const string AttributeLastWebAccess = "lastWebAccess";
        /// <summary>the favoriteCount xml attribute </summary>
01105         public const string AttributeFavoriteCount = "favoriteCount";

        /// <summary>
        /// default constructor
        /// </summary>
01110         public Statistics()
        : base(YouTubeNameTable.Statistics, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {
            this.Attributes.Add(AttributeViewCount, null);
            this.Attributes.Add(AttributeWatchCount, null);
            this.Attributes.Add(AttributeSubscriberCount, null);
            this.Attributes.Add(AttributeLastWebAccess, null);
            this.Attributes.Add(AttributeFavoriteCount, null);
        }

        /// <summary>
        /// constructor taking the initial value
        /// </summary>
        /// <param name="initValue"></param>
01124         public Statistics(string initValue)
        : base(YouTubeNameTable.Statistics, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {
            this.Attributes.Add(AttributeViewCount, null);
            this.Attributes.Add(AttributeWatchCount, null);
            this.Attributes.Add(AttributeSubscriberCount, null);
            this.Attributes.Add(AttributeLastWebAccess, null);
            this.Attributes.Add(AttributeFavoriteCount, null);
        }

        //////////////////////////////////////////////////////////////////////
        /// <summary>convienience accessor for the ViewCount</summary> 
        /// <returns> </returns>
        //////////////////////////////////////////////////////////////////////
        public string ViewCount
01139         {
           get 
            {
                return this.Attributes[AttributeViewCount] as string;
            }
            set
            {
                this.Attributes[AttributeViewCount] = value;
            }
        }

        //////////////////////////////////////////////////////////////////////
        /// <summary>convienience accessor for the Watched Count</summary> 
        /// <returns> </returns>
        //////////////////////////////////////////////////////////////////////
        public string WatchCount
01155         {
           get 
            {
                return this.Attributes[AttributeWatchCount] as string;
            }
            set
            {
                this.Attributes[AttributeWatchCount] = value;
            }
        }

        //////////////////////////////////////////////////////////////////////
        /// <summary>convienience accessor for the SubscriberCount</summary> 
        /// <returns> </returns>
        //////////////////////////////////////////////////////////////////////
        public string SubscriberCount
01171         {
           get 
            {
                return this.Attributes[AttributeSubscriberCount] as string;
            }
            set
            {
                this.Attributes[AttributeSubscriberCount] = value;
            }
        }

        //////////////////////////////////////////////////////////////////////
        /// <summary>convienience accessor for the LastWebAccess</summary> 
        /// <returns> </returns>
        //////////////////////////////////////////////////////////////////////
        public string LastWebAccess 
01187         {
           get 
            {
                return this.Attributes[AttributeLastWebAccess] as string;
            }
            set
            {
                this.Attributes[AttributeLastWebAccess] = value;
            }
        }

        //////////////////////////////////////////////////////////////////////
        /// <summary>convienience accessor for the Favorite</summary> 
        /// <returns> </returns>
        //////////////////////////////////////////////////////////////////////
        public string FavoriteCount
01203         {
           get 
            {
                return this.Attributes[AttributeFavoriteCount] as string;
            }
            set
            {
                this.Attributes[AttributeFavoriteCount] = value;
            }
        }

    }

     /// <summary>
    /// The :countHint element  specifies the number of entries in a playlist feed. 
    /// The countHint tag appears in the entries in a playlists feed, where each entry contains 
    /// information about a single playlist
    /// </summary>
01221     public class CountHint : SimpleElement
    {
        /// <summary>
        /// default constructor
        /// </summary>
01226         public CountHint()
        : base(YouTubeNameTable.CountHint, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {}
        /// <summary>
        /// constructor taking the initial value
        /// </summary>
        /// <param name="initValue"></param>
01233         public CountHint(string initValue)
        : base(YouTubeNameTable.CountHint, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {}
    }


    /// <summary>
    /// Status schema extension describing a YouTube Status
    /// </summary>
01242     public class Status : SimpleElement
    {
        /// <summary>
        /// default constructor
        /// </summary>
01247         public Status()
        : base(YouTubeNameTable.Status, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {}
        /// <summary>
        /// constructor taking the initial value
        /// </summary>
        /// <param name="initValue"></param>
01254         public Status(string initValue)
        : base(YouTubeNameTable.Status, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {}
    }

    /// <summary>
    /// UserName schema extension describing a YouTube UserName
    /// </summary>
01262     public class UserName : SimpleElement
    {
        /// <summary>
        /// default constructor
        /// </summary>
01267         public UserName()
        : base(YouTubeNameTable.UserName, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {}
        /// <summary>
        /// constructor taking the initial value
        /// </summary>
        /// <param name="initValue"></param>
01274         public UserName(string initValue)
        : base(YouTubeNameTable.UserName, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {}
    }


      /// <summary>
    /// Uploaded schema extension describing a YouTube uploaded date
    /// </summary>
01283     public class Uploaded : SimpleElement
    {
        /// <summary>
        /// default constructor
        /// </summary>
01288         public Uploaded()
        : base(YouTubeNameTable.Uploaded, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {}
        /// <summary>
        /// constructor with an init value
        /// </summary>
        /// <param name="initValue"></param>
01295         public Uploaded(string initValue)
        : base(YouTubeNameTable.Uploaded, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {}
    }


    /// <summary>
    /// VideoId schema extension describing a YouTube video identifier
    /// </summary>
01304     public class VideoId : SimpleElement
    {
        /// <summary>
        /// default constructor
        /// </summary>
01309         public VideoId()
        : base(YouTubeNameTable.VideoID, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {}
        /// <summary>
        /// constructor with an init value
        /// </summary>
        /// <param name="initValue"></param>
01316         public VideoId(string initValue)
        : base(YouTubeNameTable.VideoID, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {}
    }


    /// <summary>
    /// PlaylistId schema extension describing a YouTube playlist identifier
    /// </summary>
01325     public class PlaylistId : SimpleElement
    {
        /// <summary>
        /// default constructor
        /// </summary>
01330         public PlaylistId()
        : base(YouTubeNameTable.PlaylistId, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {}
        /// <summary>
        /// constructor with an init value
        /// </summary>
        /// <param name="initValue"></param>
01337         public PlaylistId(string initValue)
        : base(YouTubeNameTable.PlaylistId, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {}
    }


    /// <summary>
    /// PlaylistTitle schema extension describing a YouTube playlist title
    /// </summary>
01346     public class PlaylistTitle : SimpleElement
    {
        /// <summary>
        /// default constructor
        /// </summary>
01351         public PlaylistTitle()
        : base(YouTubeNameTable.PlaylistTitle, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube)
        {}
        /// <summary>
        /// constructor with an init value
        /// </summary>
        /// <param name="initValue"></param>
01358         public PlaylistTitle(string initValue)
        : base(YouTubeNameTable.PlaylistTitle, YouTubeNameTable.ytPrefix, YouTubeNameTable.NSYouTube, initValue)
        {}
    }


    /// <summary>
    /// Simple class to hold the response of a browser-based upload request
    /// </summary>
01367     public class FormUploadToken
    {
        /// <summary>
        /// The URL that the browser must POST to
        /// </summary>
01372         private string url;
        /// <summary>
        /// The token which much be included in the browser form.
        /// </summary>
01376         private string token;

        /// <summary>
        /// Simple constructor that initializes private members
        /// </summary>
        /// <param name="url">The URL that the browser must POST to</param>
        /// <param name="token">The token which much be included in the browser form.</param>
01383         public FormUploadToken(string url, string token)
        {
            this.url = url;
            this.token = token;
        }

        /// <summary>
        /// Constructor that initializes the object from a server response
        /// </summary>
        /// <param name="stream">Stream containing a server response</param>
01393         public FormUploadToken(Stream stream)
        {
            XmlDocument doc = new XmlDocument();
            doc.Load(stream);
           
            this.url = doc.GetElementsByTagName("url")[0].InnerText;
            this.token = doc.GetElementsByTagName("token")[0].InnerText;     
        }

        /// <summary>
        /// Property to access the URL the browser must POST to
        /// </summary>
        public string Url
01406         {
            get
            {
                return this.url;
            }
            set
            {
                this.url = value;
            }
        }

        /// <summary>
        /// Property to access the token the browser must include in the form POST
        /// </summary>
        public string Token
01421         {
            get
            {
                return this.token;
            }
            set
            {
                this.token = value;
            }
        }

    }
    


}

Generated by  Doxygen 1.6.0   Back to index