Protected: Schnapps & Schnee 2009

April 27th, 2008

This post is password protected. To view it please enter your password below:


Avoid those unnecessary for-loops…

April 4th, 2008

One thing that makes my - and others - code look ugly are all those for-loops repeatedly embedded into the code.

A typical example ias converting a string of comma seperated numbers into an array of integers. Here’s how to do it in one statement, without any loop:

Dim str As String = "1,2,3,4,5"
Dim ints As Integer() = Array.ConvertAll(Of String, Integer)(str.Split(","), _
    AddressOf Convert.ToInt32)
- petter


How can I access a protected member from a derived class?

April 1st, 2008

First I encountered the error message:

Compiler Error CS1540: Cannot access protected member 'member' via a qualifier
of type 'type1'; the qualifier must be of type 'type2' (or derived from it).

Then I encountered Eric Lipperts explanation of Why Can’t I Access A Protected Member From A Derived Class?

Then I got angry. Read the rest of this entry »

Powered by WordPress. Entries (RSS) and Comments (RSS).