LINQ To TwitterのUserStreamをもっと使いやすくしようとか妄想してるプロジェクト
Revision | 04ce54dfa698b664aa5943b8227e8343a0b74706 (tree) |
---|---|
Zeit | 2011-02-09 16:14:12 |
Autor | azyobuzin <azyobuzin@user...> |
Commiter | azyobuzin |
・typoでtarget_objectが取得できずに例外を吐くのを修正
・list_destroyedイベントに対応
@@ -1,2 +1,3 @@ | ||
1 | 1 | |
2 | -*.suo | |
\ No newline at end of file | ||
2 | +*.suo | |
3 | +Release/ | |
\ No newline at end of file |
@@ -242,9 +242,8 @@ namespace Azyobuzi.UserStreamEx | ||
242 | 242 | : base(line) |
243 | 243 | { |
244 | 244 | var json = DynamicJson.Parse(line); |
245 | - EventTypes eventType; | |
246 | - if (!Enum.TryParse(((string)json.@event).Replace("_", ""), true, out eventType)) | |
247 | - eventType = EventTypes.Unknown; | |
245 | + EventTypes eventType = EventTypes.Unknown; | |
246 | + Enum.TryParse(((string)json.@event).Replace("_", ""), true, out eventType); | |
248 | 247 | EventType = eventType; |
249 | 248 | CreatedAt = DateTime.ParseExact(json.created_at, "ddd MMM dd HH:mm:ss %zzzz yyyy", CultureInfo.InvariantCulture).ToLocalTime(); |
250 | 249 | Source = User.CreateUser(((string)json.source.ToString()).JsonToXml()); |
@@ -254,7 +253,7 @@ namespace Azyobuzi.UserStreamEx | ||
254 | 253 | if (json.target_object.mode()) |
255 | 254 | { |
256 | 255 | //リスト |
257 | - TargetList = List.CreateList(((string)json.target_onject.ToString()).JsonToXml(), new XElement("lists_list")); | |
256 | + TargetList = List.CreateList(((string)json.target_object.ToString()).JsonToXml(), new XElement("lists_list")); | |
258 | 257 | } |
259 | 258 | else |
260 | 259 | { |
@@ -272,17 +271,6 @@ namespace Azyobuzi.UserStreamEx | ||
272 | 271 | public List TargetList { private set; get; } |
273 | 272 | } |
274 | 273 | |
275 | - public class TrackLimitEventArgs : ReceiveJsonEventArgs | |
276 | - { | |
277 | - public TrackLimitEventArgs(string line) | |
278 | - : base(line) | |
279 | - { | |
280 | - Track = (ulong)DynamicJson.Parse(line).limit.track; | |
281 | - } | |
282 | - | |
283 | - public ulong Track { private set; get; } | |
284 | - } | |
285 | - | |
286 | 274 | public enum EventTypes |
287 | 275 | { |
288 | 276 | Unknown, |
@@ -294,6 +282,18 @@ namespace Azyobuzi.UserStreamEx | ||
294 | 282 | Block, |
295 | 283 | Unblock, |
296 | 284 | UserUpdate, |
297 | - ListCreated | |
285 | + ListCreated, | |
286 | + ListDestroyed | |
287 | + } | |
288 | + | |
289 | + public class TrackLimitEventArgs : ReceiveJsonEventArgs | |
290 | + { | |
291 | + public TrackLimitEventArgs(string line) | |
292 | + : base(line) | |
293 | + { | |
294 | + Track = (ulong)DynamicJson.Parse(line).limit.track; | |
295 | + } | |
296 | + | |
297 | + public ulong Track { private set; get; } | |
298 | 298 | } |
299 | 299 | } |