-
Notifications
You must be signed in to change notification settings - Fork 0
/
ActivityEvent.cs
113 lines (98 loc) · 3.08 KB
/
ActivityEvent.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// Type: FlickrNet.ActivityEvent
// Assembly: FlickrNet, Version=3.10.0.0, Culture=neutral, PublicKeyToken=2491df59efa5d132
// MVID: 8B8C756F-D5B2-4047-8A8B-B1C1E877A2EF
// Assembly location: D:\RMCK\vs\2014.05.24_FlickrAPI\FlickrNet.dll
using System;
using System.Xml;
namespace FlickrNet
{
public sealed class ActivityEvent : IFlickrParsable
{
public ActivityEventType EventType { get; set; }
public string UserId { get; set; }
public string UserName { get; set; }
public string RealName { get; set; }
public string IconServer { get; set; }
public string IconFarm { get; set; }
public DateTime DateAdded { get; set; }
public string Value { get; set; }
public string CommentId { get; set; }
public string NoteId { get; set; }
public string GroupId { get; set; }
public string GroupName { get; set; }
public string GalleryId { get; set; }
void IFlickrParsable.Load(XmlReader reader)
{
while (reader.MoveToNextAttribute())
{
switch (reader.LocalName)
{
case "type":
switch (reader.Value)
{
case "fave":
this.EventType = ActivityEventType.Favorite;
continue;
case "note":
this.EventType = ActivityEventType.Note;
continue;
case "comment":
this.EventType = ActivityEventType.Comment;
continue;
case "added_to_gallery":
this.EventType = ActivityEventType.Gallery;
continue;
case "tag":
this.EventType = ActivityEventType.Tag;
continue;
case "group_invite":
this.EventType = ActivityEventType.GroupInvite;
continue;
default:
continue;
}
case "user":
this.UserId = reader.Value;
continue;
case "username":
this.UserName = reader.Value;
continue;
case "dateadded":
this.DateAdded = UtilityMethods.UnixTimestampToDate(reader.Value);
continue;
case "commentid":
this.CommentId = reader.Value;
continue;
case "noteid":
this.NoteId = reader.Value;
continue;
case "galleryid":
this.GalleryId = reader.Value;
continue;
case "iconserver":
this.IconServer = reader.Value;
continue;
case "iconfarm":
this.IconFarm = reader.Value;
continue;
case "realname":
this.RealName = reader.Value;
continue;
case "group_id":
this.GroupId = reader.Value;
continue;
case "group_name":
this.GroupName = reader.Value;
continue;
default:
continue;
}
}
reader.Read();
if (reader.NodeType != XmlNodeType.Text)
return;
this.Value = reader.ReadContentAsString();
reader.Read();
}
}
}