Also, small remark:
Generally, it is better to use explicit conversion, because in case Foo foo = something as Foo; if something is not Foo, operator "as" return null reference, and in the file log.txt you can get uninformative message "Object reference not set to an instance of an object."
If you use explicit cast Foo foo = (Foo)something; if something is not Foo, cast operator throw an exception immediately, and in the log.txt you get more informative "Unable to cast object of type 'Bar' to 'Foo'".
I also want to say thank you for the source of DCE. Nice work.
Last edited by Octocat; 12-18-2011 at 03:20 AM.
|