posts - 916, comments - 758, trackbacks - 11

My Links



Post Categories

Misc. Coding

February 2010 Entries

AutoMapper question…any ideas…

In the little app I'm working on I'm using MongoDB...which is great, however MongoDB only supports storing Document objects. Which are kinda like Dictonaries (Document["blah"] = "bar";). I want to use AutoMapper to map these loosely types Key-Value Pairs to my objects and I'm basing it on some code I found drifting around: This works:   public static IMappingExpression<Document, TDestination> ConvertFromDocument<TDestination>(this IMappingExpression<Document, TDestination> exp, Func<string, string> propertyNameMapper) { foreach (PropertyInfo pi in typeof(TDestination).GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)) ...

posted @ Monday, February 15, 2010 4:13 PM | Feedback (1) |

WPF: Byte Array to Bitmap Value Converter

I wrote this for use in a little project but as I'm no longer using it, I though I'd stick it on here for anyone who wants it. Essentially, this allows you to take a byte Array (in my case, in the File property of my ThumbnailViewModel) and get it back as a BitmapImage for use in DataBinding... It also has the property of accepting a parameter which lets you specify the size of thumbnail to use (ThumbSize). Here, I actually have multiple ThumbNails (in the List<ThumbNailViewModel>) and select one using the parameter. Given this resource string and...

posted @ Saturday, February 13, 2010 3:10 PM | Feedback (0) | Filed Under [ Code Snippets XAML WPF ]

Powered by: