Blog Archives

Google Data API with RestSharp on WP7 Update

Special thanks to John Sheenan who pointed out an error in my code. First of all, calling Dispatcher.BeginInvoke is redundant since the callback action will be invoked on the main thread.

Secondly, there is a powerful deserialization feature in RestSharp. Create a simple class that will correspond to the deserialized JSON object: Read the rest of this entry

Google Data API with RestSharp on WP7

RestSharp is an open source REST client for .NET. I will use it for consuming Google Data API. You can easily install via the following NuGet command

Install-Package RestSharp

First step is creating an application in API Console and selecting services that you will be using. In this example, we will use the Tasks API. Once you create your project with the appropriate settings, you will need client_id and client_secret which is available on the API Access page. Read the rest of this entry

Useful EventArgs utility class

Although there is a generic version for EventHandler delegate available in .NET Framework: EventHandler<TEventArgs>, it requires that generic argument derives from EventArgs. For very simplistic scenarios where you want to send simple data such as string or a number, creating a new class for the event argument is little too much work. Read the rest of this entry

Windows Forms AutoSize usage (.NET bug included)

Although development of Windows Forms stopped two .NET versions ago and was pretty much replaced by WPF, there are still legacy .NET applications around based on Windows Forms. Since mixing WPF and Forms is generally a bad idea, this small article aims to show that dynamic and flexible layouts are still possible and in fact easily achieved in Windows Forms. I will also show you that there are certain hoops that need to be jumped over like .NET bugs.
Read the rest of this entry

Application.DoEvents are evil

It is no small wonder that the MSDN reference page for the Application.DoEvents method comes with a (somewhat dire) warning:
Read the rest of this entry