C# Reading content from text files

This is something I do frequently, and I always forget the streaming syntax, so here it is. There are couple of ways to do this. Firstly, from an application: From the properties panel, set the Build Action as Resource and the Copy to Output Directory as Copy Always From code this can then be accessed... Continue Reading →

Using Generics and Isolated Storage

To read and write generic objects to isolated storage, you will need to pass the object types. This is so the DataContractSerializer knows how to process the object. So, to write data: /// /// Write a generic object to Isolated Storage/// /// Type of object being written/// The object being written/// The location to write... Continue Reading →

C# Event Delegates

Using the "+=" notation when creating delegate event is a really fastway of coding but there is a caveat if the delegate is declared in thewrong place. for example declaring the handler inline, in a method: private void btn_Click(object sender, System.Windows.RoutedEventArgs e){EventBus.Event+= new EventHandler(EventBus_Event);//....do code here} When the btn_Click method is fired, an event handler... Continue Reading →

A WordPress.com Website.

Up ↑