C# error CS1540

 Sep 12th, 2012 

There are many ways in which one could violate the rules of Object Oriented Programming in C#. Fortunately, the C# compiler is smart enough to prevent many of them, like the one in the example below. Can you  figure out why the compiler doesn’t allow the call in the last method?

Continue reading »

Using UAC with C# – Part 3

 Jan 6th, 2010 

After a long period since I wrote part 2 of this article I decided to add some extra information. There is one thing that was missed by the previous two articles: the design of UAC enabled applications. If you use Windows Vista/7 then you know that buttons and links which elevate privileges are preceded by […]

Continue reading »

First CodeProject article – WPFDesigner

 Aug 30th, 2008 

Today I’ve posted my first article on CodeProject. The article describes how to create a custom control in which you add elements and you can move/resize them. The article can be found here.

Continue reading »

Programming Puns

 Jul 19th, 2008 

Writing code, comments, variable names, etc., in the manner that they create a pun: byte me; long john_silver; char broiled; string vest; float valve; double jeopardy; struct by_lightning { … }; Object strongly; class warfare { … }; String cheese; Exception taken; Graphics ex; // XXX long walk(short pier) { } // from the MrBunny […]

Continue reading »

How expensive are cross-domain operations?

 Apr 28th, 2008 

I was curios how expensive is a cross domain operation so I have made a test. The test procedure is simple. Perform a number of cross-domain and non cross-domain operations (get the value of NextNumber() from same domain and from another domain) and measure the time elapsed. For each value I have runned the application […]

Continue reading »

EventInfo.AddEventHandler – bug or not?

 Apr 16th, 2008 

Reflection is the process by which a computer program can observe and modify its own structure and behavior. The programming paradigm driven by reflection is called reflective programming. [Wikipedia] Working a few days ago on a plugin architecture on .NET Framework I’ve found something very interesting. The method System.Reflection.EventInfo.AddEventHandler does late-binding. You’ll probably say “so […]

Continue reading »