lambda_codeblock_anonymous
Differences
This shows you the differences between two versions of the page.
lambda_codeblock_anonymous [2018/01/30 05:09] – created wolfgangriedmann | lambda_codeblock_anonymous [2018/01/30 05:10] (current) – wolfgangriedmann | ||
---|---|---|---|
Line 20: | Line 20: | ||
Some examples of this in use: | Some examples of this in use: | ||
< | < | ||
- | | + | |
- | oForm := Form{} | + | oForm := Form{} |
- | // Anonymous method expression with 2 statements. Note that the | + | // Anonymous method expression with 2 statements. Note that the |
- | // first statement must appear on the line following the opening Curly | + | // first statement must appear on the line following the opening Curly |
- | // and the closing curly must be on a separate line after the statements | + | // and the closing curly must be on a separate line after the statements |
- | // (because the statement list ' | + | // (because the statement list ' |
- | oForm:Click += DELEGATE(o AS System.Object, | + | oForm:Click += DELEGATE(o AS System.Object, |
System.Windows.Forms.MessageBox.Show(" | System.Windows.Forms.MessageBox.Show(" | ||
System.Windows.Forms.MessageBox.Show(" | System.Windows.Forms.MessageBox.Show(" | ||
| | ||
- | | + | |
- | oForm:Click += { o,e => System.Windows.Forms.MessageBox.Show(" | + | oForm:Click += { o,e => System.Windows.Forms.MessageBox.Show(" |
- | | + | |
- | // For readability here split over 2 lines with a semicolon that indicates | + | // For readability here split over 2 lines with a semicolon that indicates |
- | // that the statement is continued on the next line | + | // that the statement is continued on the next line |
- | oForm:Click += { o as Object,e as EventArgs ; | + | oForm:Click += { o as Object,e as EventArgs ; |
=> System.Windows.Forms.MessageBox.Show(" | => System.Windows.Forms.MessageBox.Show(" | ||
- | | + | |
- | RETURN< | + | RETURN</code> |
| | ||
Source: [[https:// | Source: [[https:// | ||
lambda_codeblock_anonymous.txt · Last modified: 2018/01/30 05:10 by wolfgangriedmann