private static void CheckForChanges()
            {
                bool flag = false;

                if ((s_RasHelper != null) && s_RasHelper.HasChanged)
                {
                    s_RasHelper.Reset();
                    flag = true;
                }
                if ((s_AddressChange != null) && s_AddressChange.CheckAndReset())
                {
                    flag = true;
                }
                if (flag)
                {
                    Interlocked.Increment(ref s_CurrentVersion);
                    s_CurrentAutoDetector = new AutoWebProxyScriptEngine.AutoDetector(UnsafeNclNativeMethods.RasHelper.GetCurrentConnectoid(), s_CurrentVersion);
                }
            }
 private static void Initialize()
 {
     if (!s_Initialized)
     {
         lock (s_LockObject)
         {
             if (!s_Initialized)
             {
                 s_CurrentAutoDetector = new AutoWebProxyScriptEngine.AutoDetector(UnsafeNclNativeMethods.RasHelper.GetCurrentConnectoid(), 1);
                 if (NetworkChange.CanListenForNetworkChanges)
                 {
                     s_AddressChange = new NetworkAddressChangePolled();
                 }
                 if (UnsafeNclNativeMethods.RasHelper.RasSupported)
                 {
                     s_RasHelper = new UnsafeNclNativeMethods.RasHelper();
                 }
                 s_CurrentVersion = 1;
                 s_Initialized    = true;
             }
         }
     }
 }