コード例 #1
0
 private void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e)
 {
     if (e.IsAvailable)
         _annunciator.ConnectivityState = ConnectivityState.HaveInternet;
     else
         _annunciator.ConnectivityState = ConnectivityState.Configured;
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: marinehero/microserver
        private void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e)
        {
            Logger.WriteInfo("RPTR", "Network availability: " + e.IsAvailable.ToString());

            if (e.IsAvailable == true)
            {
                Server.StartAll();
            }
            else
            {
                Server.StopAll();
            }
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: marinehero/microserver
        private void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e)
        {
            if (e.IsAvailable == true)
            {
                cyclingDisplay.AddMessage("key1", "IP Address" + "\n" + netWifi.NetworkInterface.IPAddress);
                cyclingDisplay.AddMessage("key2", "Host Name" + "\n" + "cobra");
                cyclingDisplay.AddMessage("key3", "SSID" + "\n" + "cobra");
                cyclingDisplay.AddMessage("key4", "Key" + "\n" + "12345");

                Server.InterfaceAddress = netWifi.NetworkInterface.IPAddress;
                Server.DhcpService.NameServers = new NameServerCollection(netWifi.NetworkInterface.IPAddress);

                // start all enabled services
                Server.StartAll();
                cyclingDisplay.StartStopCycle(true);
            }
            else
            {
                // stop all enabled services
                Server.StopAll();
                cyclingDisplay.StartStopCycle(false);
            }
        }
コード例 #4
0
        private static void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e)
        {
            if (e.IsAvailable)
            {
                NETWORK = true;
                PosStates(Screen.prices, true);
            }
            else
            {
                NETWORK = false;

                int[] display = PosStates(Screen.blank);
                for (int i = 1; i <= settings.positions; i++)
                {
                    if (display[i] == 0)
                    {
                        Buttons.Write(i, Cmd.Refresh);
                    }
                }
                Buttons.Write(ALL, Cmd.Print, 12, 17, 0, 1, "NETWORK IS NOT");
                Buttons.Write(ALL, Cmd.Print, 24, 33, 0, 1, "AVAILABLE");
            }
        }
コード例 #5
0
            private void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e)
            {
                // the event might not be from this network interface, so ignore it if it does not represent the current status of this network module
                if (e.IsAvailable != IsNetworkConnected) return;

                // also ignore the event if this network module is already in that state (so we don't send events twice to users)
                if (e.IsAvailable == _networkAvailable) return;

                if (e.IsAvailable)
                {
                    if (_useDHCP)
                    {
                        _needDHCP.Set();
                    }
                    else
                    {
                        _isNetworkUp = true;
                        OnNetworkEvent(this, NetworkState.Up);
                    }
                }
                else
                {
                    _isNetworkUp = false;
                    OnNetworkEvent(this, NetworkState.Down);
                }
                _networkAvailable = e.IsAvailable;
            }
コード例 #6
0
ファイル: Program.cs プロジェクト: dxmakers/connectthedots
 private void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e)
 {
     Debug.Print("network is " + (e.IsAvailable ? "Available" : "Isn't Available"));
 }
コード例 #7
0
 private void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs network)
 {
     NetworkAvailability(network.IsAvailable);
 }
コード例 #8
0
ファイル: Program.cs プロジェクト: Mecabot/ble2azure
 void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e)
 {
     Debug.Print("network " + (e.IsAvailable ? "is available" : "isn't Available"));
 }
コード例 #9
0
        internal static void OnNetworkChangeCallback(NetworkEvent networkEvent)
        {
            switch (networkEvent.EventType)
            {
                case NetworkEventType.AvailabilityChanged:
                    {
                        if (NetworkAvailabilityChanged != null)
                        {
                            bool isAvailable = ((networkEvent.Flags & (byte)NetworkEventFlags.NetworkAvailable) != 0);
                            NetworkAvailabilityEventArgs args = new NetworkAvailabilityEventArgs(isAvailable);

                            NetworkAvailabilityChanged(null, args);
                        }
                        break;
                    }
                case NetworkEventType.AddressChanged:
                    {
                        if (NetworkAddressChanged != null)
                        {
                            EventArgs args = new EventArgs();
                            NetworkAddressChanged(null, args);
                        }

                        break;
                    }
                default:
                    {
                        break;
                    }
            }
        }
コード例 #10
0
ファイル: Program.cs プロジェクト: TomasFilingr/EASY-WINE
 private static void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e)
 {
     if (!e.IsAvailable)
     {
         HttpSettings.ONLINE = false;
         if (!INIT)
         {
             lcd.Print(0, 104, 2, 4, CommonFunc.StringFill(40, "      --------------------------"));
             lcd.Print(0, 128, 2, 4, CommonFunc.StringFill(40, "     | NETWORK IS NOT AVAILABLE |"));
             lcd.Print(0, 152, 2, 4, CommonFunc.StringFill(40, "      --------------------------"));
         }
     }
     else
     {
         if (INIT)
         {
             HttpSettings.NetworkSettings(true);
         }
         else
         {
             HttpSettings.ONLINE = true;
             int screen = (int)lcd.Screen;
             lcd.Screen = (SCREEN)screen;
         }
     }
 }
コード例 #11
0
 void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e)
 {
     networkAvailable = true;
 }
コード例 #12
0
 private void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e)
 {
     Debug.Print(" The network " + (e.IsAvailable ? "is " : "is not ") + "available");
 }
コード例 #13
0
        /// <summary>
        /// Event handler to signal that the network is now available.
        /// </summary>
        /// <param name="sender">
        /// The object that initiated the event.
        /// </param>
        /// <param name="networkAvailabilityEventArgs">
        /// The event arguments associated with the change in network availability,
        /// </param>
        private void OnInternalNetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs networkAvailabilityEventArgs)
        {
            if (networkAvailabilityEventArgs.IsAvailable)
            {
                m_WaitForNetwork.Set();
            }

            OnInternalNetworkAvailabilityChanged(this, networkAvailabilityEventArgs.IsAvailable);
        }
コード例 #14
0
ファイル: Program.cs プロジェクト: tvjames/NetduinoPlayground
 static void OnNetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e)
 {
     if (e.IsAvailable)
     {
         // update timer immediately when network is available
         _ntpTimer.Change(TimeSpan.Zero, new TimeSpan(0, ClockUpdateMinutes, 0));
     }
 }