Click here to monitor SSC

2010 November


Simon Cooper

Subterranean IL: Pseudo custom attributes

0 comments

Custom attributes were designed to make the .NET framework extensible; if a .NET language needs to store additional metadata on an item that isn’t expressible in IL, then an attribute could be applied to the IL item to represent this metadata. For instance, the C# compiler uses DecimalConstantAttribute and DateTimeConstantAttribute to represent compile-time decimal or […]

30 November 2010 5:25 pm by
Bart Read

ReSharper C# Live Template for Declaring Routed Event

0 comments

Here’s another WPF ReSharper Live Template for you. This one is for declaring standalone routed events of any type. Again, it’s pretty simple:        #region $EVENTNAME$ Routed Event       public static readonly RoutedEvent $EVENTNAME$Event = EventManager.RegisterRoutedEvent(            "$EVENTNAME$",           RoutingStrategy.$ROUTINGSTRATEGY$,           typeof( $EVENTHANDLERDELEGATE$ ),           typeof( $DECLARINGTYPE$ ) );       public event $EVENTHANDLERDELEGATE$ $EVENTNAME$       {           add { AddHandler( $EVENTNAME$Event, value […]

30 November 2010 2:46 pm by
Bart Read

ReSharper C# Live Template for Read-Only Dependency Property and Routed Event Boilerplate

0 comments

Following on from my previous post, where I shared a Live Template for quickly declaring a normal read-write dependency property and its associated property change event boilerplate, here’s an unsurprisingly similar template for creating a read-only dependency property.        #region $PROPNAME$ Read-Only Property and Property Change Routed Event        private static readonly DependencyPropertyKey $PROPNAME$PropertyKey =                                             […]

30 November 2010 12:28 pm by
Tony Davis

Copy wrongs and Copyright

11 comments

Recently, a Chinese blog website copied, wholesale and without permission, a Simple-Talk article on troubleshooting locking and blocking. Our initial reaction was exasperation and anger, tempered slightly by the fact that there was, at the top, a clear link to the original, and the book from which it was extracted. On the day the copy […]

29 November 2010 1:42 pm by
John Magnabosco

Converting Encrypted Values

0 comments

Your database has been protecting sensitive data at rest using the cell-level encryption features of SQL Server for quite sometime. The employees in the auditing department have been inviting you to their after-work gatherings and buying you drinks. Thousands of customers implicitly include you in their prayers of thanks giving as their identities remain safe […]

28 November 2010 3:43 am by
Simon Cooper

Subterranean IL: Custom modifiers

2 comments

In IL, volatile is an instruction prefix used to set a memory barrier at that instruction. However, in C#, volatile is applied to a field to indicate that all accesses on that field should be prefixed with volatile. As I mentioned in my previous post, this means that the field definition needs to store this […]

26 November 2010 5:04 pm by
Fatherjack

Using SQL Sentry Plan Explorer

3 comments

LiveJournal Tags: How To,SSMS,Tips and tricks,Execution Plans This is a quick tip that I hope will help you use SQL Sentry’s Plan Explorer tool. It’s a really great tool for viewing Execution Plans – something that SSMS isn’t too great at. If you don’t have the tool then you can download it for free from […]

25 November 2010 3:00 pm by
Bart Read

WPF: How to get the bounds of a control in an automatic layout container, in the container coordinate space

0 comments

Googling this the other day, I started to get the impression that this might be annoyingly tricky. You might wonder why this is necessary at all, given that WPF implements layout for you in most cases (except for containers such as Canvas), but trust me, if you’re developing custom elements, at some point you’re probably […]

24 November 2010 1:41 pm by
Simon Cooper

Subterranean IL: Volatile

0 comments

This time, we’ll be having a look at the volatile. prefix instruction, and one of the differences between volatile in IL and C#. The volatile. prefix volatile is a tricky one, as there’s varying levels of documentation on it. From what I can see, it has two effects: It prevents caching of the load or […]

24 November 2010 1:22 pm by
Brian Donahue

Updating the managed debugging API for .NET v4

1 comment

In any successful investigation, the right tools play a big part in collecting evidence about the state of the “crime scene” as it was before the detectives arrived. Unfortunately for the Crash Scene Investigator, we don’t have the budget to fly out to the customer’s site, chalk the outline, and eat their doughnuts. We have to […]

24 November 2010 11:03 am by
Older posts