1
/* Copyright (c) 2008 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.
16
* Oct 13 2008 Joe Feser joseph.feser@gmail.com
25
using System.Collections;
26
using Google.GData.Client;
27
using Google.GData.Extensions;
29
namespace Google.GData.YouTube {
32
//////////////////////////////////////////////////////////////////////
34
/// Entry API customization class for defining comment entries in an comments feed.
36
//////////////////////////////////////////////////////////////////////
37
public class ComplaintEntry : YouTubeBaseEntry
40
/// Describes the nature of the complaint
42
public enum ComplaintType
45
/// The video contains sexual content
49
/// The video contains violent or repulsive content
53
/// The video contains hateful or abusive content
57
/// The video contains harmful or dangerous acts
61
/// The video infringes on the complainant's rights or copyright.
65
/// The video is clearly spam.
69
/// The type of complaint is not set yet.
74
/// Constructs a new CommentEntry instance
76
public ComplaintEntry()
79
Tracing.TraceMsg("Created complaint entry");
81
Content c = new Content();
87
/// getter/setter for yt:content subelement
89
public string Complaint
93
return getYouTubeExtensionValue(YouTubeNameTable.Content);
97
setYouTubeExtension(YouTubeNameTable.Content, value);
103
/// gets and sets the associated atom:category
105
public ComplaintType Type
109
ComplaintType t = ComplaintType.UNKNOWN;
111
foreach (AtomCategory category in this.Categories)
113
if (category.Scheme == YouTubeNameTable.ComplaintCategorySchema)
117
t = (ComplaintType) Enum.Parse(typeof(ComplaintType), category.Term, true);
119
catch (ArgumentException)
121
t = ComplaintType.UNKNOWN;
129
AtomCategory cat = null;
130
foreach (AtomCategory category in this.Categories)
132
if (category.Scheme == YouTubeNameTable.ComplaintCategorySchema)
140
cat = new AtomCategory();
141
this.Categories.Add(cat);
143
cat.Term = value.ToString();
144
cat.Scheme = new AtomUri(YouTubeNameTable.ComplaintCategorySchema);