Oct 162012
 

UPDATE: due to many requests, I have compiled the code below into a project that you can download from here: Validation.zip

To my big surprise the Microsoft team behind the WinRT XAML framework has decided not to include the built-in support for validation that exists in the WPF and Silverlight frameworks. Anyway, for anyone that needs an alternative, I have created a set of helper classes to make things easier.

Shout it

Continue reading »

Sep 222012
 

With the changes to the UAC system in Windows 8, it seems that whenever you try to launch an non-elevated application from an elevated application, you get an error similar to: “Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)”.

The reason is that under Windows 8, even if you set UAC to the lowest setting, you don’t disable it completely.

In my case, I was trying to start an URL using the default browser from an elevated application. After a lot of digging around on stackoverflow.com and other blogs and websites, I’ve managed to build a solution that seems to be working.

Continue reading »

Oct 052011
 

In one of my recent projects I have reached the need to validate that I have all dependencies correctly registered in my UnityContainer. For those that are not familiar with Unity, it is a dependency injection container that allows constructor, property and method call dependency injection.

You can get more information about how Unity works and also download the latest release from Codeplex: http://unity.codeplex.com/

Shout it

 

Continue reading »

Feb 122011
 

 

Pentru cei care nu au reusit sa ajunga la intalnirea Ronua Sibiu din Noiembrie, puteti gasi aici slide-urile de la prezentarea pe care am tinut-o legat de dezvoltarea de aplicatii complexe Silverlight si/sau WPF folosind Microsoft Patterns & Practices PRISM. In slide-uri sunt prezentate recomandarile ce constituie PRISM, precum si elemente arhitecturale ce pot fi folosite in realizarea aplicatiilor composite.

Continue reading »

Feb 122011
 

 

In this blog post I am presenting a simple validation framework that you can reuse in your code. Also I will be putting here two code snippets that will make it easier for you to add preconditions to your code.

When Visual Studio 2010 was first realeased, one of the features that I expected the most was code contracts. Unfortunately after including them in one of my large projects, it became more clear that at this moment it is not mature enough to be used. Build time increases rapidly when having a lot of source code files and using the code contracts. Enabling static contract validation is even worse, almost doubling the build time on an average development machine.

All that being said, I really like the code contracts way of specifying preconditions. Most of the time I don’t use post-conditions, but being able to specify validation criteria means that the code will be more robust.

Continue reading »

May 102010
 

In the first part I’ve written about creating a code generator in VS2008 to eliminate repetitive coding.

The series is divided into four parts:

Part I  – creating a Visual Studio Package

Part II (this one) – creating and registering a code generator

Part III – generating code & debugging

Part IV – creating the setup project and deploying the package

So let’s jump directly to the problem at hand:

Continue reading »