~iwarford/do-plugins/fart-plugin-fwiw

« back to all changes in this revision

Viewing changes to RememberTheMilk/src/RtmNet/Tags.cs

  • Committer: Jason Jones
  • Date: 2008-12-24 04:45:02 UTC
  • mfrom: (335.1.9 do-plugins)
  • Revision ID: jasonedwardjones@gmail.com-20081224044502-ra56ym06cp1iqs7t
MergedĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
using System;
 
2
using System.Xml;
 
3
 
 
4
namespace RtmNet
 
5
{
 
6
        /// <summary>
 
7
        /// A simple tag class, containing a tag name and optional count (for <see cref="Rtm.TagsGetListUserPopular()"/>)
 
8
        /// </summary>
 
9
        public class Tag
 
10
        {
 
11
                private string _tagName;
 
12
                private int _count;
 
13
 
 
14
                /// <summary>
 
15
                /// The name of the tag.
 
16
                /// </summary>
 
17
                public string TagName
 
18
                {
 
19
                        get { return _tagName; }
 
20
                }
 
21
 
 
22
                /// <summary>
 
23
                /// The poularity of the tag. Will be 0 where the popularity is not retreaved.
 
24
                /// </summary>
 
25
                public int Count
 
26
                {
 
27
                        get { return _count; }
 
28
                }
 
29
 
 
30
                internal Tag(XmlNode node)
 
31
                {
 
32
                        if( node.Attributes["count"] != null ) _count = Convert.ToInt32(node.Attributes["count"].Value);
 
33
                        _tagName = node.InnerText;
 
34
                }
 
35
 
 
36
                internal Tag(string tagName, int count)
 
37
                {
 
38
                        _tagName = tagName;
 
39
                        _count = count;
 
40
                }
 
41
        }
 
42
}