Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A delegate is an object which refers to a method or you can consider it as a variable that holds a reference to a method. It provides a way to know which method is called when an event is triggered. 

Note

A delegate will only call only a method which agrees with its signature and return type. A method can be either a static method associated with a class, or it can be an instance method associated with an object, it doesn’t matter. 


Code Block
Dictionary<int, ArgumentValue[]> mapEmployeeToOrders = null;
private ArgumentValue[] SparklineCollectionDelegate(string fieldName, System.Data.DataRow row)
{
ArgumentValue[] sourceCollection;
int  emplID  =  TK.To< int>(row["EmployeeID"]);
if (!this.mapEmployeeToOrders.TryGetValue(emplID, out sourceCollection)) 
       sourceCollection = new ArgumentValue[0];
return sourceCollection;
}

...