/
Entities.cs
93 lines (84 loc) · 2.31 KB
/
Entities.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
namespace MiniTwitter.Net.Twitter
{
[Serializable]
[XmlRoot("entities")]
public class Entities : PropertyChangedBase
{
private UserMentions userMentions;
[XmlElement("user_mentions")]
public UserMentions UserMentions
{
get { return userMentions; }
set
{
if (userMentions != value)
{
userMentions = value;
OnPropertyChanged("UserMentions");
}
}
}
private Urls urls;
[XmlElement("urls")]
public Urls Urls
{
get { return urls; }
set
{
if (urls != value)
{
urls = value;
OnPropertyChanged("Urls");
}
}
}
private HashTags hashtags;
[XmlElement("hashtags")]
public HashTags Hashtags
{
get { return hashtags; }
set
{
if (hashtags != value)
{
hashtags = value;
OnPropertyChanged("Hashtags");
}
}
}
private media media;
[XmlElement("media")]
public media Media
{
get { return media; }
set
{
if (media!=value)
{
media = value;
OnPropertyChanged("Media");
}
}
}
#if DEBUG
public override string ToString()
{
var sb = new StringBuilder();
if (UserMentions != null && UserMentions.UserMention != null)
{
UserMentions.UserMention.AsParallel().ForAll(um => sb.AppendFormat("{0}-{1};ID {2};Name {3};Screen Name {4}\n", um.StartIndex, um.EndIndex, um.ID, um.Name, um.ScreenName));
}
if (Urls != null && Urls.URL != null)
{
Urls.URL.AsParallel().ForAll(url => sb.AppendFormat("{0}, At {1}, Is {2}", url.URL, url.DisplayUrl, url.ExpandedUrl));
}
return sb.ToString();
}
#endif
}
}