Esempio n. 1
0
 private void rasDialer1_StateChanged(object sender, DotRas.StateChangedEventArgs e)
 {
     if (this.isVerbose)
     {
         BeginInvoke((MethodInvoker) delegate()
         {
             addConnectionLog(e.State.ToString());
         });
     }
 }
Esempio n. 2
0
 /// <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");
 }
Esempio n. 3
0
 /// <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);
 }
Esempio n. 4
0
 private void Target_StateChanged(object sender, StateChangedEventArgs e)
 {
     if (e.State == this.signalOnState)
     {
         this.stateWaitHandle.Set();
     }
 }
Esempio n. 5
0
        private void rasDialer_StateChanged(object sender, StateChangedEventArgs e)
        {
            if (rasProperties != null)
				rasProperties.Info(string.Format("RAS connection state: {0}", e.State.ToString()));
        }
Esempio n. 6
0
 private void _rasDialer_StateChanged(object sender, StateChangedEventArgs e)
 {
     Console.WriteLine("State changed to: " + e.State.ToString());
 }
Esempio n. 7
0
        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;
        }
Esempio n. 8
0
File: VPNCore.cs Progetto: kangwl/xk
 void dialer_StateChanged(object sender, StateChangedEventArgs e)
 {
     DialState(e.State.ToString());
 }
Esempio n. 9
0
 /// <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);
 }
Esempio n. 10
0
 /// <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");
 }
Esempio n. 11
0
 private void dialer_StateChanged(object sender, StateChangedEventArgs e)
 {
     this.AppendStatusText(string.Join(string.Empty, new string[] { e.State.ToString(), "\r\n" }));
 }
Esempio n. 12
0
 private void Dialer_StateChanged(object sender, StateChangedEventArgs e)
 {
     OnConnectionStatusChangedEvent(e.State);
 }
Esempio n. 13
0
 private void dialer_StateChanged(object sender, StateChangedEventArgs e)
  {
      this.StatusTextBox.AppendText(string.Format("{0}\r\n", e.State.ToString()));
      this.StatusTextBox.ScrollToEnd();
  }