C # 2.0 has a neat feature called anonymous functions. This is intended for use mainly with events:
Button.Click += delegate(System.Object o, System.EventArgs e) { System.Windows.Forms.MessageBox.Show("Click!"); };
Now suppose Button is a static member, then adding delegates to it will be considered unmanaged resources. Normally, I would have to unregister the handler before overwriting it again. This is a fairly common example of using GUI programming.
What are the recommendations with anonymous features? Does this happen evenly? If yes, then when?
source share