Category Archives: Silverlight

Anything related to Microsoft Silverlight

Limiting the Number of Results from LINQ

How can you limit the number of objects returned from a LINQ query, i.e. only request the first N objects (similar to MySQL’s LIMIT keyword)? The answer is via the Take(n) LINQ method; it pulls the first N rows specified. Continue reading

Posted in Core .NET, Silverlight, Web, Wndows Forms, WPF | Tagged , | Leave a comment

Tools Update: BaseEncoder and Hasher

We’ve updated the Tools library again. You can now convert integers to an from an arbitrary base (binary, hexadecimal, base64, or any base you wish) as well as calculate SHA-1 hashes of strings with one function call. Useful! Continue reading

Posted in Libraries, Silverlight, Web, Wndows Forms | Tagged , | Leave a comment

Unit Testing and Code-Coverage in Silverlight

You can run unit-testing and code-coverage on Silverlight applications (NUnit, PartCover, et all) with a bit of foresight and reorganization of your code. You can test core logic and classes, albeit not Silverlight-specific code. I show you how. Continue reading

Posted in Core .NET, Silverlight, Tools | Tagged , , , | 1 Comment

Persistent Storage 1.1: Arbitrary Object Serialization

Persistent Storage 1.1 brings a much-needed feature: the ability to serialize any arbitrary object quickly and efficiently — even without specifying any attributes. Thanks to Mike Talbot of Alterian for his Silverlight serializer. Continue reading

Posted in Libraries, Silverlight | Tagged , | 1 Comment

Optimization 101

How do you optimize your application? Should you? When? How? We go over the basics, with six “rules” that you can follow to help you effectively improve your application performance. Continue reading

Posted in Core .NET, Silverlight, Uncategorized, Web, Wndows Forms | Tagged , , , | 1 Comment

Silverlight Audio Player

Playing audio files in Silverlight is non-trivial. Hence, the need for a library that allows you to do so; so this is another Tools update to include an AudioManager Silverlight-only class. What does it do? It allows you to play … Continue reading

Posted in Libraries, Silverlight | Tagged , | Leave a comment

Tools Update: Read Embedded Text Files in Silverlight

Tools now includes a EmbeddedResourceFileReader class that allows you to read the contents of text files at runtime; this is exciting for Silverlight development, where you may have lots of data you want to dump into a file and read at runtime. Well, now you can! Continue reading

Posted in Core .NET, Libraries, Silverlight, Wndows Forms | Tagged , , , | Leave a comment

Normal Distribution Random Generator Available!

We’re pleased to announce a new reusable library: a normally-distributed random number generator. It works like a standard integer random number generator, but produces a normal (bell-curve) distribution instead of a uniform (flat) one. We also packaged a Mersenne Prime implementation with it. Continue reading

Posted in Libraries, Silverlight, Web, Wndows Forms | Tagged , | 1 Comment

The “using” Statement and IDisposable

The using statement allows you to create a block of text around an object (or multiple objects), that implements IDisposable, and to have the CLR automatically call Dispose on that object (or multiple objects). Continue reading

Posted in Core .NET, Silverlight, Web, Wndows Forms | Tagged , , , | 4 Comments

String.IndexOf vs. Regexp.Match

How fast is String.IndexOf vs. Regexp.Match? In a 10,000 word text, while searching for a single word located only once at the end of the text, the results were stunning: Regexp.match is more than 70x faster than the equivalent String.IndexOf. That’s a huge difference! Continue reading

Posted in Core .NET, Silverlight, Web, Wndows Forms | Tagged , , | Leave a comment