Common Delegate Call
b.Click += delegate(object sender, EventArgs e)
{
Log("Sender :" + sender + "EventArgs " + e);
};
Same as
Using
Lambda
1. Call Action with Parameter
(o, e) => {
// Statements
}
2. Call Action Without Parameter
() => { // Statements }3. Implement Action
Public void ImplementAction(Action a){ a(); }4. Create Objectstring className = "MyClass";
var obj = (T) Activator.CreateInstance(Type.GetType(className));
No comments:
Post a Comment