Miscellaneous Debris
Avner Kashtan's Frustrations and Exultations
-
A silly little C# language feature request: .! operator
When we step back for a moment from our SOAs and Factories and Polymorphism, we have to admit that at the root of much of our code lie a hell of a lot of simple if/else statements. Like it or not, … more
-
File Properties in Word 2007
A client asked me the other day what happened to File->Properties in Word 2007. They simply couldn't find it.In the Beta1 TR, I remember it was confusingly located on the Status Bar (!) – … more
-
A Better Obfuscation, or How To Write Code That Will Make Someone Kill You
The following code is perfectly valid C#, and compiles without errors: int _;_ = 5; If we take it a bit further, we can do something like this: int _, __, ___, ____; _ = 5; __ = 10; ___ = 15; ____ = 2 … more
-
Ping Notifier!
How many times have you connected to a server via Remote Desktop to install some components?How many have you rebooted a remote server and sat around waiting for it to go up?How many times have you … more
-
Visual Studio obstructing DebugView
I've mentioned it before, but SysInternal's DebugView is a great utility. It allows you to get the Debug.WriteLine() strings from your application even when you're not attached with a debugger, … more
-
Some thoughts on uninstalling Sharepoint '12' Beta 1
I'm uninstalling an old beta of the Sharepoint servers from a VPC I have on my computer to make room for the newer Beta 2 servers, and I noticed several things: 1) The installation originally … more
-
My Singleton is disappearing!
WCF's Instance Context model allows me to specify my service's instantiation behavior - I can get a new instance for every call, have WCF manage a session for me and keep an instance per session, or … more
-
Hiding properties from the Property Grid
Taking a break from the main components, I decided to get around to writing a small configuration editor using .NET 2.0's lovely ability to edit .config files from code. I have a custom Section … more
-
URIs are not local paths.
It's easy to forget that even though a local filesystem path ("C:\MyDir\MyFile.dll") can be represented as a Uri (file://C:/MyDir/MyFile.dll), these two entities are different, and have different … more
-
ParamArrays and CLS-compliance.
In my previous post, I noted that when I write this code in C#: public void MyMethod (params object[] args) { ... } What I actually get in my IL is this: public void MyMethod ([System.ParamArray] … more