The previous answer is correct. Just thought I'd add that you can also create a delegate to store a "pointer" to a function. You can pass that around just like any other variable. Here is an example:
public class MyClass
{
public int FunctionName(int val1, int val2)
{
return val1 + val2;
}
}
public class SomeOtherClass
{
private delegate int IntDelegate(int val1, int val2);
private IntDelegate storedFunction = null;
public void StoreFunctionPointer(MyClass myInstance)
{
storedFunction = myInstance.FunctionName;
}
public int CallStoredFunction(int val1, int val2)
{
return storedFunction(val1, val2);
}
}
If you wanted, you could then store those function pointers in a dictionary to look them up using a string key.