Your SlideShare is downloading. ×
VT.NET user group 2014-04-21: Delegation and C# delegates
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

VT.NET user group 2014-04-21: Delegation and C# delegates

235
views

Published on

Slides from my April 2014 presentation to the Vermont .NET user group.

Slides from my April 2014 presentation to the Vermont .NET user group.

Published in: Software, Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
235
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Back to Basics: Delegates Rob Hale April 21, 2014
  • 2. Goals ● Delegation pattern review ● Delegates in C#
  • 3. Delegation Design Pattern
  • 4. Delegation design pattern - simple Delegator Delegatee
  • 5. Delegation design pattern - slightly more complicated Delegator IDelegatee Concrete Delegatee1 Concrete Delegatee2
  • 6. Coding time...
  • 7. Delegates in C#
  • 8. What are Delegates? ● Delegates are a reference type that defines a method signature ○ Like C++ function pointers but are type safe ○ Unlike method overloading, the return type is part of the signature ● They allow methods to be passed as parameters ● They can be used to define callback methods ● They can be chained together ○ For example, multiple methods can be called on a
  • 9. Coding Time...
  • 10. Resources Code from this presentation ● https://github. com/robhalevt/20140421_VTdotNET_DelegationAndDelegates Other reading ● http://msdn.microsoft.com/en-us/library/vstudio/ms173171(v=vs.100).aspx ● http://msdn.microsoft.com/en-us/library/orm-9780596516109-03-09.aspx ● http://en.wikipedia.org/wiki/Delegation_pattern ● http://stackoverflow.com/questions/2044301/what-is-delegate