| Visual Basic (Declaration) | |
|---|---|
Public Delegate Sub PopProgressEventHandler( _ ByVal sender As Object, _ ByVal e As PopProgressEventArgs _ ) | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim instance As New PopProgressEventHandler(AddressOf HandlerMethod) | |
| C# | |
|---|---|
public delegate void PopProgressEventHandler( object sender, PopProgressEventArgs e ) | |
| Managed Extensions for C++ | |
|---|---|
public: __gc __delegate void PopProgressEventHandler( Object* sender, PopProgressEventArgs* e ) | |
| C++/CLI | |
|---|---|
public delegate void PopProgressEventHandler( Object^ sender, PopProgressEventArgs^ e ) | |
Parameters
- sender
- e
As Microsoft describes in their MSDN documentation, the event model in the .NET Framework is based on having an event delegate that connects an event with its handler. To raise an event, two elements are needed:
- A class that holds the event data. This class must derive from the base class EventArgs.
- A delegate that points to a method that provides the response to the event.
When capturing progress information is desired, the class that holds the event data is the PopProgressEventArgs class. A method must be created with the same signature as the delegate. If you are working within the Visual Studio.NET environment, this can be automatically done for you. See the "Using Events In PowerTCP" topic for more information. If you are not working within the Visual Studio.NET environment, you must do this yourself. In this example that would mean a method would have to be defined to accept two arguments (an object and an PopProgressEventArgs) and return void. Once this has been done, the delegate must be "connected" to the handling event. This is done by adding an instance of the delegate to the event (see examples below). For more information about event handler delegates, see the "Using Events In PowerTCP" topic.
Target Platforms: Microsoft .NET Framework 2.0