void NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e) { if (e.IsAvailable) { this.Invoke((Action) delegate { RetrySend(); }); } else { MessageBox.Show("网络已断开"); } }
private static void NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e) { if (e.IsAvailable) { LogHelper.WriteLog("Network Available"); } else { LogHelper.WriteLog("Network Unavailable"); } }
private void AvailabilityChanged(object sx, NetworkAvailabilityEventArgs ex, exceptionMessage s, object fileName) { if (!ex.IsAvailable) { s($"{fileName.ToString()} : Connection lost"); } else { s($"{fileName.ToString()} : Connection established"); } }
private void AvailabilityChanged(object sender, NetworkAvailabilityEventArgs e) { if (e.IsAvailable) { Console.WriteLine("Network connected!"); } else { Console.WriteLine("Network dis connected!"); } }
private void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e) { try { htServerPipePool.Clear(); //KProxyApplication.Log.LogFormat("KProxy.network.availability.change> Network Available: {0}", new object[] { e.IsAvailable }); } catch { } }
/// <summary>When Network availability changes, this method is invoked.</summary> public void OnNetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e) { if (e.IsAvailable) { login_window.DisplayNetworkAvailability("Network status: Available"); } else { login_window.DisplayNetworkAvailability("Network status: Unavailable"); } }
void NetworkChangeNetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e) { IsConnected = e.IsAvailable; UpdateStatus(); ConnectionStatusChangedEventHandler handler = ConnectionStatusChangedEvent; if (handler != null) { handler(IsConnected); } }
private static void NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e) { if (e.IsAvailable) { Console.WriteLine("Network Is Available"); } else { Console.WriteLine("Network Is Not Available"); } }
public void AvailabilityChanged(object sender, NetworkAvailabilityEventArgs e, IntenetSlow s, string filename) { if (e.IsAvailable) { s($"Connection Established : {filename}"); } else { s($"Connection Not Available : {filename}"); } }
private async void HandleNetworkChange(object sender, NetworkAvailabilityEventArgs e) { if (!waitingForConnectivity) { return; } if (e.IsAvailable) { await SynchronizeAsync().ConfigureAwait(false); } }
void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e) { if (e.IsAvailable) { finito = true; Console.WriteLine("Network is Available"); } else { Console.WriteLine("Network is Unavailable"); } }
private async void OnNetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e) { if (!e.IsAvailable) { return; } foreach (var account in Accounts) { await account.TakeOnlineAsync(); } }
private void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e) { if (e.IsAvailable) { MessageBox.Show("Network is connected."); } else { MessageBox.Show("Network is not connected."); } }
// Signal or unsignal the network availability event when the network availability change private void NetworkAvailabilityChangeCallback(object sender, NetworkAvailabilityEventArgs e) { Log.Debug("Network availability changed: " + e.IsAvailable.ToString()); if (e.IsAvailable) { networkUp.Set(); } else { networkUp.Reset(); } }
/* ----------------------------------------------------------------- */ /// /// OnNetworkChanged /// /// <summary> /// NetworkChanged イベントを発生させます。 /// </summary> /// /* ----------------------------------------------------------------- */ protected virtual void OnNetworkChanged(NetworkAvailabilityEventArgs e) { if (Network.Available && State == TimerState.Suspend) { Resume(TimeSpan.FromMilliseconds(100)); } else if (!Network.Available && State == TimerState.Run) { Suspend(); } NetworkChanged?.Invoke(this, e); }
private void AvailabilityChanged(object sender, NetworkAvailabilityEventArgs e) { if (e.IsAvailable) { HasInternet = e.IsAvailable; this.Init(); } else { HasInternet = e.IsAvailable; } }
///System.Net.NetworkInformation.NetworkChange.NetworkAvailabilityChanged ///System.Net.NetworkInformation.NetworkChange.NetworkAddressChanged /// /// // Declare a method to handle NetworkAvailabilityChanged events. private static void NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e) { // Report whether the network is now available or unavailable. if (e.IsAvailable) { Console.WriteLine("Network Available"); } else { Console.WriteLine("Network Unavailable"); } }
/// <summary> /// <para>EventHandler of <see cref="NetworkChange.NetworkAvailabilityChanged"/></para> /// <para>Throws the event <see cref="OnNetworkAvailabilityChanged"/> if neccessary</para> /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e) { if (e.IsAvailable.Equals(oldValues[EventType.NetworkAvailabilityChanged])) { return; } if (OnNetworkAvailabilityChanged != null) { OnNetworkAvailabilityChanged(this, new EventArgsValue <bool>(e.IsAvailable)); } oldValues[EventType.NetworkAvailabilityChanged] = e.IsAvailable; }
// 自訂當網路的有效性變更時所呼叫的方法 private void NetworkAvailabilityChangedCallback(object sender, NetworkAvailabilityEventArgs e) { // 取得目前網路的連線狀態 if (e.IsAvailable) { StatusBar.Text = "Network interface is up."; } else { StatusBar.Text = "The network is not available."; } }
private static void WhenNetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e) { if (e.IsAvailable) { Console.WriteLine("Network Available"); new App().Start(); } else { Console.WriteLine("Network Unavailable"); } }
private void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e) { if (!e.IsAvailable) { OnNetworkDead(new EventArgs()); OnDisconnectedFromServer(new EventArgs()); } else { OnNetworkAlived(new EventArgs()); } }
private async void AvailabilityChanged(object sender, NetworkAvailabilityEventArgs e) { if (!e.IsAvailable) { await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async() => { Frame.Navigate(typeof(NoConnection)); }); } NetworkChange.NetworkAvailabilityChanged -= AvailabilityChanged; }
private void HandleNetworkChange(object sender, NetworkAvailabilityEventArgs e) { if (!waitingForConnectivity) { return; } if (e.IsAvailable) { Synchronize(); } }
void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e) { if (e.IsAvailable) { Program.Init(); Trace.WriteLine("Network became available"); } else { Program.KillSocket(); Trace.WriteLine("Network went down"); } }
private void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e) { if (e.IsAvailable) { //MessageBox.Show("Network connected!"); lblmsg.Text = "Network connected!"; } else { //MessageBox.Show("Network disconnected!"); lblmsg.Text = "Network disconnected!"; } }
/// <summary> /// Prevent no-internet crashing /// (crashes anyways, but at least deleting the partial data and displaying a message to the uses) /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e) { if (BeforeNetworkAvailabilityChangedHandling(sender, e)) { return; } if (!e.IsAvailable) { MessageBox.Show("Internet access has dropped. Closing application..."); ProtocolAbortCurrentDownload(true); Process.GetCurrentProcess().Kill(); } }
private void networkChangedEvent(object sender, NetworkAvailabilityEventArgs e) { if (e.IsAvailable) { this.networkLabel.Text = "Internet Available"; this.networkLabel.ForeColor = Color.DarkGreen; } else { this.networkLabel.Text = "Internet not Available"; this.networkLabel.ForeColor = Color.DarkRed; } }
private void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e) { logger.Debug("NetworkAvailabilityChanged got"); if (e.IsAvailable) { logger.Trace("Network changed to up"); isStillConnected(CHECKHOST); } else { logger.Trace("Network changed to down."); } }
/// <summary> /// This event fires whenever all network adapters loose network connectivity (link) and fires when any network adapter re-gains a link. /// </summary> private static void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e) { IsNetworkAvailable = e.IsAvailable; if (e.IsAvailable) { Logger.Info("Network is now available.", ConsoleColor.Green); } else { Logger.Warning("Network is no longer available."); EnsuranceCancel.Cancel(); } }
static void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e) { Debug.Print("Network available: " + e.IsAvailable.ToString()); if (e.IsAvailable) { Time_Service.Start(); } else { Time_Service.Stop(); } }
private void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e) { Debug.Print("Network availability: " + e.IsAvailable.ToString()); }
private void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e) { }