Cs 3260
Download
1 / 4

C# Delegates - PowerPoint PPT Presentation


  • 191 Views
  • Uploaded on

CS 3260. C# Delegates. C++ Function Pointers C# Method References Groundwork for Lambda Functions. Overview. Reference Type Type Declaration delegate void MyDelegate ( int ival , double dval ); Variable Declaration MyDelegate mdel = new MyDelegate ( MyMethod ); Method Declaration

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' C# Delegates' - harlan


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Cs 3260

CS 3260

C# Delegates


Overview

C++ Function Pointers

C# Method References

Groundwork for Lambda Functions

Overview


C delegates

  • Reference Type

  • Type Declaration

    • delegate void MyDelegate(intival, double dval);

  • Variable Declaration

    • MyDelegatemdel = new MyDelegate(MyMethod);

  • Method Declaration

    • void MyMethod(intiv,doubledv){ … }

  • Method Call via the Delegate

    • mdel(100,5.5);

  • Type-Safe

  • Can have generic parameters

C# Delegates


Generic delegate

delegate T Gdelegate<T,K>(T tval,Kkval);

Func<>

Action<>

Generic Delegate


ad