26.02.2015 Views

C#.Net Migration - A2Z Dotnet

C#.Net Migration - A2Z Dotnet

C#.Net Migration - A2Z Dotnet

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Multiple targets<br />

• Can combine delegates using operator+= or operator+<br />

– creates invocation list of delegates<br />

– all targets called when delegate invoked<br />

– targets called in order added<br />

– use of += ok even when left-hand-side is null<br />

targets<br />

Parent mom = new Parent();<br />

Parent dad = new Parent();<br />

Student ann = new Student("Ann");<br />

first<br />

second<br />

ann.Targets += new GradeChange(mom.Report);<br />

ann.Targets += new GradeChange(dad.Report);<br />

...<br />

74

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!