Skip to main content

Posts

Showing posts with the label WP7 WP7Contrib SilverlightSerializer C#

WP7Contrib: 'IsCachable' is here to help!

We've added the method 'IsCachable ()' to the ICacheProvider to help diagnose and test suitability of entities for caching. It can be used in a live application but we expect it to be more likely used during testing. We don't see any problems with exposing this method on the interface as it has no side affects for the entity being tested or for the cache provider being evaluated against. Any exceptions which occur whilst calling this method are caught and not exposed. The complete signature for the method is shown below: bool IsCacheable<T>(T value, ref IEnumerable<Type> failingTypes) where T : class; The suitability for caching will be returned as the boolean result and any failing types are returned via the ref parameter 'faillingTypes'. Obviously the internal implementation is dependent on the cache provider being used. The method will always return true for the In Memory & Null Cache Providers because neither of these implementation...

WP7Contrib: Updated version of SilverlightSerializer

Mike Talbot's release a new version of SilverlightSerializer - keep up the great work! Mike's blog can be found here with a list of the improvements for v2. Obviously a performance improvement is always welcomed especially on a mobile device, but for me the biggest change is the friendly exception message support he's added. Several people using the WP7Contrib had said it was difficult to debug serialisation issues when using the Isolated Cache Provider because when it threw an exception invariably it would be the 'MissingMethodException'. At best this was a good pointer to problems with serialisation at worst it gave no really indication of where to look. So the previous version (v1) gave the following output for the Cache Provider demo in the WP7Contrib Spikes directory, when the Isolated Cache Provider is attempting to serialize the cache contents (to isolated storage on a background thread) it's throwing the 'MissingMethodException' exception...