A day in the life...

public class GeekEarth : Earth { }
posts - 26, comments - 8236, trackbacks - 0

April 2011 Entries

Identified associations (maps)

I thought I’d share this approach to having named associations.  Let’s say you have an Address class with a Name property on it, your Employee can have a property like this 1 var homeAddress = new Address(.....); 2 homeAddress.Line1 = "192 Blah Street"; 3 homeAddress.Line2 = "etc"; 4 employee.Addresses["Home"] = homeAddress; 5 6 var workAddress = new Address(.....); 7 workAddress.Line1 = "123 Meh Road"; 8 workAddress.Line2 = "etc"; 9 employee.Addresses["Work"] = workAddress;   Once you have created your Employee and Address classes add a private association from Employee to Address named something like _Addresses.  Then add the following code to the Employee class. 1 IdentifiedAssociation<string, NamedPostalAddress> postalAddresses; 2...

posted @ Tuesday, April 12, 2011 10:57 AM | Feedback (346) |

A WebServer for MonoTouch that also parses posted form data (HttpListenerRequest)

I found a few examples of web servers for MonoTouch but none of them parsed the data sent in a POST request.  I looked around the web and was unable to find any examples of how to achieve this.  So now that I’ve written it myself I’ve decided to share my own implementation.  This includes not only the code for processing the form post data but also for registering request handlers etc. Here is an example of how you would use the web server 1 public BookUploadViewController() 2 ...

posted @ Saturday, April 02, 2011 6:58 PM | Feedback (347) | Filed Under [ Code ]

Powered by: