/// <summary> /// Enable the connection for use. /// </summary> public void Connect() { if (Connection == IntPtr.Zero) { throw new ApplicationException("Connection not established."); } if (WindowTimer.Enabled) { throw new ApplicationException("Connection timer already running."); } WindowTimer.Start(); }
/// <summary> /// Called by the timer package when the window timer elapses, on the /// main thread. /// </summary> /// <param name="sender">Unused.</param> /// <param name="e">Unused.</param> private void WindowTimer_Tick(object sender, EventArgs e) { if (Connection == IntPtr.Zero) { return; } // // Allow the NetLayerWindow package to perform periodic, time-based // tasks, and set the timer for future expiration. // WindowTimer.Interval = (int)AuroraServerNetLayerTimeout(Connection); WindowTimer.Start(); }