Assuming you're not talking about events - of course you can program around it. The point is to make it nicer and cleaner.
protected void Sort()
{
foreach (string key in _dBase.Keys)
{
Array.Sort>>(_dBase[key],
new Comparison>>(
delegate(Pair> a, Pair> b)
{
if (a == null && b != null)
return 1;
else if (a != null && b == null)
return -1;
else if (a == null && b == null)
return 0;
else
return a.First.CompareTo(b.First);
}));
}
}
Could I do that without an inline delegate? Sure. Would I have a floppy private method in my class that would only be used for this one instance? Yup.
Edit: As mentioned in the comments, you can simplify:
Array.Sort>>(_dBase[key],
new Comparison>>(
delegate(Pair> a, Pair> b)
{
to
Array.Sort>>(_dBase[key], (a,b) =>
{