Professional Documents
Culture Documents
Week 2:
About delegates and events (what we did last week),
2 extra examples and
a bit about the week-2-stuff
A delegate stands in for a (mysterious
list of) actual methods
1. Define the prototype (the heading) of the actual methods the
delegate will stand for.
2. Then define a delegate.
3. You can add and remove actual methods the delegate stands for.
2
public class Motorbike Example
{
private int speed, maxSpeed;
3
public class Motorbike Example
{
4
In another class:
Example
private void ShowSpeedInPits(Motorbike m, int s) { . . . }
5
Today:
1. Extra: How to use a RFID-reader (from Phidgets)
(see next slide and demo)
6
The RFID-reader from Phidgets (phidgets.com)
1. Download the driver (on Phidgets.com ????????? -> 64-bits
installer download) or https://www.phidgets.com/docs/OS_-_Windows,
and install it on your laptop.
2. Start a project in Visual Studio.
3. Add a reference to the dll
( to C:/Program Files/Phidgets/Phidget22/Phidget22.NET.dll )
4. Add using-statements to your VS-project:
using Phidget22;
using Phidget22.Events;
See demo.