1
/* Copyright (c) 2006 Google Inc.
3
* Licensed under the Apache License, Version 2.0 (the "License");
4
* you may not use this file except in compliance with the License.
5
* You may obtain a copy of the License at
7
* http://www.apache.org/licenses/LICENSE-2.0
9
* Unless required by applicable law or agreed to in writing, software
10
* distributed under the License is distributed on an "AS IS" BASIS,
11
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
* See the License for the specific language governing permissions and
13
* limitations under the License.
20
using System.Collections;
21
using Google.GData.Client;
22
using Google.GData.Extensions;
23
using System.Globalization;
26
namespace Google.GData.YouTube {
29
//////////////////////////////////////////////////////////////////////
31
/// Entry API customization class for defining entries in an Playlist feed.
33
//////////////////////////////////////////////////////////////////////
34
public class PlaylistsEntry : YouTubeBaseEntry
37
/// Category used to label entries as Playlistentries
39
public static AtomCategory PLAYLISTS_CATEGORY =
40
new AtomCategory(YouTubeNameTable.KIND_PLAYLIST_LINK, new AtomUri(BaseNameTable.gKind));
43
/// Constructs a new PlayListEntry instance
45
public PlaylistsEntry()
48
Tracing.TraceMsg("Created PlaylistsEntry");
50
if (this.ProtocolMajor == 1)
52
Description d = new Description();
53
FeedLink f = new FeedLink();
58
CountHint c = new CountHint();
60
this.AddExtension(new Private());
63
Categories.Add(PLAYLISTS_CATEGORY);
69
/// getter/setter for Description subelement
71
[Obsolete("replaced with Summary.Text")]
72
public string Description
76
return getDescription();
80
setDescription(value);
85
/// getter/setter for the feedlink subelement
87
[Obsolete("replaced with Content.Src.Content")]
88
public FeedLink FeedLink
92
return FindExtension(GDataParserNameTable.XmlFeedLinkElement,
93
BaseNameTable.gNamespace) as FeedLink;
98
ReplaceExtension(GDataParserNameTable.XmlFeedLinkElement,
99
BaseNameTable.gNamespace,
105
/// returns the int value of the countHint tag
107
/// yt:countHint specifies the number of entries in a playlist feed. The yt:countHint tag appears in the entries in a playlists feed,
108
/// where each entry contains information about a single playlist.</para>
110
/// <returns>-1 if no counthint was present, else the value</returns>
115
CountHint c = getYouTubeExtension(YouTubeNameTable.CountHint) as CountHint;
118
return c.IntegerValue;
124
CountHint c = getYouTubeExtension(YouTubeNameTable.CountHint) as CountHint;
128
this.ExtensionElements.Add(c);
130
c.IntegerValue = value;
135
/// getter/setter for the private subelement. Indicates if the playlist is private
141
return Convert.ToBoolean(getYouTubeExtensionValue(YouTubeNameTable.Private), CultureInfo.InvariantCulture);
145
setYouTubeExtension(YouTubeNameTable.Private, value == false ? null : "");