All posts by Justin Stenning

C# – Enable / Disable DWM Composition (Aero)

As a follow up for C# – Screen capture with Direct3D, here is how to enable and disable composition (Aero) on Windows Vista and Windows 7.
Continue reading C# – Enable / Disable DWM Composition (Aero)

Development Tools – NDepend

I have been playing with NDepend for the past week or so, and have found it to be a useful addition to an Architect’s/Developer’s artillery for larger more complex projects.

NDepend is a static code analysis tool written by Patrick Smacchia (C# MVP) that simplifies managing a large/complex .NET code base.

Whether you are responsible for QA, code reviews, architecture, or day to day development on large complex projects, you will most likely find something useful in NDepend.

Selection by Metrics (top 10 lines of code count) and highlighting of those methods in the Metrics View
Metrics View: Hightlighting the top 10 methods based on number of lines of code.

Continue reading Development Tools – NDepend

C# – Compile-time checking of property names for Data Bindings

Ever wished you could bind properties to your input controls without using literal strings to identify the property name?

Want the compiler to check the property names are valid at compile time rather than waiting until/if it’s found while testing?

Here is an example of how to determine the name of a property using the property name as compilable code via Lambda’s

(Updated 9th Oct 2009 to support binding paths that extend beyond a first-level property)

Continue reading C# – Compile-time checking of property names for Data Bindings

SQL Server 2005: Error: 18452 Login failed for user ‘username’. The user is not associated with a trusted SQL Server connection.

Login failed for user ‘username’. The user is not associated with a trusted SQL Server connection.

This error occurs when you attempt to login to SQL Server using SQL Server Authentication mode (username + password) when the SQL Server instance is only configured for Windows Authentication.

To fix the issue:

  1. Enable SQL Server Authentication
  2. Enable the “sa” user, and configure a password for it
  3. Restart the SQL Server Instance

Continue reading SQL Server 2005: Error: 18452 Login failed for user ‘username’. The user is not associated with a trusted SQL Server connection.

C# – Screen capture with Vista DWM (Shared Direct3D Surface)

When I was researching for this article, I noticed some passing references to the Vista DWM (Desktop Window Manager) and the ability to use it to capture images of windows — DWM is the technology behind Windows Aero and its window switching features like Flip3D. I filed this away as something to look into at a later date.
Continue reading C# – Screen capture with Vista DWM (Shared Direct3D Surface)

ASP.NET 2.0 page and control life-cycle diagram

I recently had to begin working on some ASP.NET development, specifically composite controls for web forms and SharePoint custom fields and web parts, and not knowing a great deal about ASP.NET (or SharePoint for that matter), I set out into Google land to discover all I could about the ASP.NET page request and how my snazzy new controls would have to fit into it.
Continue reading ASP.NET 2.0 page and control life-cycle diagram