private void rasDialer1_StateChanged(object sender, DotRas.StateChangedEventArgs e) { if (this.isVerbose) { BeginInvoke((MethodInvoker) delegate() { addConnectionLog(e.State.ToString()); }); } }
/// <summary> /// Occurs when the dialer state changes during a connection attempt. /// </summary> /// <param name="sender">The object that raised the event.</param> /// <param name="e">An <see cref="DotRas.StateChangedEventArgs"/> containing event data.</param> private void Dialer_StateChanged(object sender, StateChangedEventArgs e) { this.StatusTextBox.AppendText(e.State.ToString() + "\r\n"); }
/// <summary> /// Raises the <see cref="RasDialer.StateChanged"/> event. /// </summary> /// <param name="e">An <see cref="DotRas.StateChangedEventArgs"/> containing event data.</param> private void OnStateChanged(StateChangedEventArgs e) { this.RaiseEvent <StateChangedEventArgs>(this.StateChanged, e); }
private void Target_StateChanged(object sender, StateChangedEventArgs e) { if (e.State == this.signalOnState) { this.stateWaitHandle.Set(); } }
private void rasDialer_StateChanged(object sender, StateChangedEventArgs e) { if (rasProperties != null) rasProperties.Info(string.Format("RAS connection state: {0}", e.State.ToString())); }
private void _rasDialer_StateChanged(object sender, StateChangedEventArgs e) { Console.WriteLine("State changed to: " + e.State.ToString()); }
private bool RasDialCallback(IntPtr callbackId, int subEntryId, IntPtr dangerousHandle, int message, RasConnectionState state, int errorCode, int extendedErrorCode) { bool retval = true; lock (this.syncRoot) { RasHandle connectionHandle = null; try { connectionHandle = new RasHandle(dangerousHandle, subEntryId > 1); if (!this.IsBusy) { // The connection is no longer being dialed, stop receiving notifications for this connection attempt. retval = false; } else { string errorMessage = null; if (errorCode != NativeMethods.SUCCESS) { errorMessage = RasHelper.Instance.GetRasErrorString(errorCode); } StateChangedEventArgs e = new StateChangedEventArgs(callbackId, subEntryId, connectionHandle, state, errorCode, errorMessage, extendedErrorCode); this.OnStateChanged(e); if (errorCode != NativeMethods.SUCCESS) { this.Abort(); this.PostCompleted(new RasDialException(errorCode, extendedErrorCode), false, false, false); retval = false; } else if (state == RasConnectionState.Connected) { this.PostCompleted(null, false, false, true); } } } catch (Exception ex) { this.OnError(new System.IO.ErrorEventArgs(ex)); } finally { DiagnosticTrace.Default.TraceEvent(TraceEventType.Verbose, new RasDialCallbackTraceEvent(retval, callbackId, subEntryId, dangerousHandle, message, state, errorCode, extendedErrorCode)); if (connectionHandle != null) { connectionHandle.Dispose(); } } } return retval; }
void dialer_StateChanged(object sender, StateChangedEventArgs e) { DialState(e.State.ToString()); }
/// <summary> /// Raises the <see cref="RasDialer.StateChanged"/> event. /// </summary> /// <param name="e">An <see cref="DotRas.StateChangedEventArgs"/> containing event data.</param> private void OnStateChanged(StateChangedEventArgs e) { this.RaiseEvent<StateChangedEventArgs>(this.StateChanged, e); }
/// <summary> /// Occurs when the dialer state changes during a connection attempt. /// </summary> /// <param name="sender">The object that raised the event.</param> /// <param name="e">An <see cref="DotRas.StateChangedEventArgs"/> containing event data.</param> private void Dialer_StateChanged(object sender, StateChangedEventArgs e) { //this.tMessage.AppendText(e.State.ToString() + "\r\n"); }
private void dialer_StateChanged(object sender, StateChangedEventArgs e) { this.AppendStatusText(string.Join(string.Empty, new string[] { e.State.ToString(), "\r\n" })); }
private void Dialer_StateChanged(object sender, StateChangedEventArgs e) { OnConnectionStatusChangedEvent(e.State); }
private void dialer_StateChanged(object sender, StateChangedEventArgs e) { this.StatusTextBox.AppendText(string.Format("{0}\r\n", e.State.ToString())); this.StatusTextBox.ScrollToEnd(); }