Tutorial at http://msdn.microsoft.com/en-us/library/ms752299%28v=vs.110%29.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-23