private void client_GetFriendTimeLineCompleted(object sender, GetFriendTimelineCompletedEventArgs e) { if (IsFirstLoad) { IsFirstLoad = false; Globals.FriendTimeline = e.Result; LayoutRoot.DataContext = Globals.FriendTimeline; } else { int count = 0; if (Globals.FriendTimeline.Count > 0) { string FirstID = Globals.FriendTimeline[0].FriendTwitterID; foreach (FriendTimelineList newitem in e.Result) { if (FirstID != newitem.FriendTwitterID) { count++; } else { break; } } for (int i = 0; i < count; i++) { Globals.FriendTimeline.Insert(i, e.Result[i]); //if (toastWindow != null && toastWindow.Visibility == Visibility.Visible) // toastWindow.Close(); if (ConfigurationSettings.NotificationDisable) { NotificationWindow nw = new NotificationWindow(); nw.Width = 400; nw.Height = 100; nw.Closed += new EventHandler(OnNotificationClosed); nw.Content = new NotificationControl(nw, e.Result[i].UsersItem.TwitterName, e.Result[i].FriendTwitterContent, e.Result[i].UsersItem.CustomizeImageURL, e.Result[i].UsersItem.IsVerified); AddNotificationToQueue(nw); } //toastWindow = new NotificationWindow(); //toastWindow.Width = 400; //toastWindow.Height = 100; //toastWindow.Closed += new EventHandler(OnNotificationClosed); //toastWindow.Content = new NotificationControl(toastWindow, // e.Result[i].UsersItem.TwitterName, // e.Result[i].FriendTwitterContent, // e.Result[i].UsersItem.CustomizeImageURL); ////toastWindow.Show((int)ConfigurationSettings.NotificationTimer); //AddNotificationToQueue(toastWindow); } LayoutRoot.DataContext = Globals.FriendTimeline; } } }
private void client_GetFriendTimeLineCompleted(object sender, GetFriendTimelineCompletedEventArgs e) { if (IsFirstLoad) { IsFirstLoad = false; Globals.FriendTimeline = e.Result; LayoutRoot.DataContext = Globals.FriendTimeline; } else { int count = 0; if (Globals.FriendTimeline.Count > 0) { string FirstID = Globals.FriendTimeline[0].FriendTwitterID; foreach (FriendTimelineList newitem in e.Result) { if (FirstID != newitem.FriendTwitterID) { count++; } else break; } for (int i = 0; i < count; i++) { Globals.FriendTimeline.Insert(i, e.Result[i]); //if (toastWindow != null && toastWindow.Visibility == Visibility.Visible) // toastWindow.Close(); if (ConfigurationSettings.NotificationDisable) { NotificationWindow nw = new NotificationWindow(); nw.Width = 400; nw.Height = 100; nw.Closed += new EventHandler(OnNotificationClosed); nw.Content = new NotificationControl(nw, e.Result[i].UsersItem.TwitterName, e.Result[i].FriendTwitterContent, e.Result[i].UsersItem.CustomizeImageURL, e.Result[i].UsersItem.IsVerified); AddNotificationToQueue(nw); } //toastWindow = new NotificationWindow(); //toastWindow.Width = 400; //toastWindow.Height = 100; //toastWindow.Closed += new EventHandler(OnNotificationClosed); //toastWindow.Content = new NotificationControl(toastWindow, // e.Result[i].UsersItem.TwitterName, // e.Result[i].FriendTwitterContent, // e.Result[i].UsersItem.CustomizeImageURL); ////toastWindow.Show((int)ConfigurationSettings.NotificationTimer); //AddNotificationToQueue(toastWindow); } LayoutRoot.DataContext = Globals.FriendTimeline; } } }