void backgroundWorkerPersonalStream_DoWork(object sender, DoWorkEventArgs e) { Tuple <List <Post>, ApiCallResponse> items; ParametersMyStream parameter = new ParametersMyStream(); parameter.count = Properties.Settings.Default.TwitterItemsFetchInPast; if (PersonalStream.Count > 0) { parameter.since_id = PersonalStream.Max(i => i.Id).ToString(); } parameter.include_annotations = true; items = SimpleStreams.getUserStream(this.accessToken, parameter); if (items.Item2.success) { foreach (Post post in items.Item1) { if (!post.machine_only && !string.IsNullOrEmpty(post.text) && !post.is_deleted) { ApnItem item = new ApnItem(post, this); if (item != null) { item.receivingAccount = this; backgroundWorkerPersonalStream.ReportProgress(50, item); } } } if (items.Item1 != null) { backgroundWorkerPersonalStream.ReportProgress(99, items.Item2); } } }
public MainWindow() { InitializeComponent(); Tuple <List <Post>, ApiCallResponse> posts_response = SimpleStreams.getUnifiedStream(Properties.Settings.Default.access_token); // the response is a general comcept in the API: A tuple containing the data (in this case a list of posts) and an "ApiCallResponse" with the metadata if (posts_response.Item2.success) { listview_items.ItemsSource = posts_response.Item1; // of course this is very basic as we just show the ToString() method } }