Glossary Item Box

PowerTCP Email Validation for .NET

Using Events

Events are very important for using PowerTCP because communications works best in applications when it occurs asynchronously. The application can validate an email address or a list of email addresses, perform other tasks, and have an event raised when the validation completes. The application, however, is responsible for "hooking up" events to the application's "event handler."

Within the Visual Studio environment, this is most easily accomplished by dragging the Validator component onto a form, and using the Properties window to create an event handler.

Alternatively, for non-Visual Studio environments, or when using a component as a reference, you have to "wire-up" events to an "event handler" by adding the code yourself. The following C# code snippet shows how the Visual Studio wires up an event handler. You can use the same technique in any development environment:

[C#]
//Signals the completion of an asynch BeginValidate call
Validator1.EndValidate += new Dart.PowerTCP.Validator.ValidateEventHandler(Validator1_EndValidate);

//Provides progress information when validating an email address
Validator1.Progress += new Dart.PowerTCP.Validator.ProgressEventHandler(Validator1_Progress);

//Provides debug information when the component communicates with mail servers
Validator1.Smtp.Trace += new Dart.PowerTCP.Validator.SegmentEventHandler(Validator1_Smtp_Trace);

You will probably need to perform some event processing, depending upon the complexity of your application.

 

In This Section

Overview
This topic provides an overview for using PowerTCP Email Validation for .NET.
Placing Components on a Form
This topic demonstrates how to create and use components using Visual Studio .NET.
Creating Components Dynamically
This topic demonstrates how to add a component as a reference using Visual Studio .NET.
Synchronous vs. Asynchronous Use
This topic discusses the benefits and uses for synchronous and asynchronous methods.
Using Events
This topic discusses how to use events with the component, both using Visual Studio .NET and in other environments.

 

 

 


Send comments on this topic.

Documentation version 1.0.3.0.

© 2008 Dart Communications.  All rights reserved.