| Visual Basic (Declaration) | |
|---|---|
<DescriptionAttribute("Raised when the value of the Busy property changes.")> <CategoryAttribute("Progress")> Public Event BusyChanged As EventHandler | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim instance As Pop Dim handler As EventHandler AddHandler instance.BusyChanged, handler | |
| C# | |
|---|---|
[DescriptionAttribute("Raised when the value of the Busy property changes.")] [CategoryAttribute("Progress")] public event EventHandler BusyChanged | |
| Managed Extensions for C++ | |
|---|---|
[DescriptionAttribute("Raised when the value of the Busy property changes.")] [CategoryAttribute("Progress")] public: __event EventHandler* BusyChanged | |
| C++/CLI | |
|---|---|
[DescriptionAttribute("Raised when the value of the Busy property changes.")] [CategoryAttribute("Progress")] public: event EventHandler^ BusyChanged | |
The following example demonstrates using the BusyChanged event to see if the socket is busy.
| Visual Basic | Copy Code |
|---|---|
' Be sure to import the namespace by putting "Imports Dart.PowerTCP.Mail" ' at the top of your class. Private Sub BusyTest() ' Do something to cause the Busy event to be raised Pop1.Login("mail.test.com", "me", "mypass") End Sub Private Sub Pop1_BusyChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Pop1.BusyChanged If Pop1.Busy Then Label1.Text = "Socket is busy" Else Label1.Text = "Socket is not busy" End If End Sub | |
| C# | Copy Code |
|---|---|
// Be sure to import the namespace by putting "using Dart.PowerTCP.Mail;" // at the top of your class. private void BusyTest() { // Do something to cause the Busy event to be raised pop1.Login("mail.test.com", "me", "mypass"); } private void pop1_BusyChanged(object sender, System.EventArgs e) { // Check the Busy property. if(pop1.Busy) label1.Text = "Socket is busy"; else label1.Text = "Socket is not busy"; } | |
This event is fired when the value of the Object.Busy property changes. The Object.Busy property changes when a method is executing that is occupying the TCP connection.
This event is useful in several scenarios, for example:
- Displaying to the user when the PowerTCP component is busy.
- Taking action within your application when the PowerTCP component is no longer busy.
If you are using the PowerTCP component as a reference, you must create a method to handle the event yourself. For more information on using events using PowerTCP.NET within the Visual Studio.NET environment, see Using Events In PowerTCP.
Target Platforms: Microsoft .NET Framework 2.0