DevicesManager.ConnectAsync Method (TimeSpan)

 

Asynchronously connects the devices manager to the devices provider with the specified time-out period.

Namespace:   Microsoft.WindowsServerSolutions.Common.Devices
Assembly:  DevicesOM (in DevicesOM.dll)

Syntax

public void ConnectAsync(
    TimeSpan timeout
)
public:
void ConnectAsync(
    TimeSpan timeout
)
Public Sub ConnectAsync (
    timeout As TimeSpan
)

Parameters

  • timeout
    Type: System.TimeSpan

    Specifies the time-out period for the connection.

Examples

The following code example shows how to asynchronously connect the devices manager to the devices provider with the specified time-out period.

TimeSpan timeOut = TimeSpan.FromSeconds(5);

DevicesManager dm = new DevicesManager();
dm.ConnectionOpened += new EventHandler<EventArgs>(dm_ConnectionOpened);
dm.ConnectAsync(timeOut);

The following code example shows how to implement the delegate method.

static void dm_ConnectionOpened(object sender, EventArgs e)
{
   Console.WriteLine("Connection opened.");
}

See Also

ConnectAsync Overload
DevicesManager Class
Microsoft.WindowsServerSolutions.Common.Devices Namespace

Return to top