Thanks,
firstly, I manually created the thread because I have no Idea what I am doing. Threading is so new to me. I have used the backgroundworker class before, as it handles it all for you and even accepts and returns and object by default. but I needed a direct implementation any my gui was freezing during http requests.
you know, I never did get that whole anonymous delegate thing, so I still invoke on my main thread's event handler using
this.Invoke(new UpdateTextCallback(this.UpdateText), new object[] { e.TimeLine_Statuses });
then create a delegate and a method
public delegate void UpdateTextCallback(statuses text);
private void UpdateText(statuses text)
{ statuses twitStatuses = text;
foreach (statusesStatus stats in twitStatuses.status)
{
richTextBox1.Text = richTextBox1.Text + "\n" + stats.text + " - user: " + stats.user[0].name;
}
}
but I will try that anonymous approach.
Also, I didn't really understand why in your link that you only did the read response stream in Async and not the entire request. But either way I needed more, my http request ironically also a twitter api wrapper, makes a request for a user's "friendtimeline" and receives the xml, then deserializes it based on a schema class and returns that "statuses" object to the UI where it can easily get any information about the post.
I got both the synchronous and Asynchronous methods in my class when I get to using it in my newest hobby project I will be able to choose which best suits my needs.
I have gotten it working, just that whole invoke delegate with a callback thing on the form that I don't like.
question! Would calling the event from a delegate not require me to invoke the event data on the GUI thead?
public event EventHandler SomeEvent;
private void SampleEvent()
{
var del = this.SomeEvent;
if (del != null)
del(this, new EventArgs());
}
and thanks again for all the handy info.