private void Connectivity_ConnectivityChanged(object sender, Xamarin.Essentials.ConnectivityChangedEventArgs e) { if (e.NetworkAccess != NetworkAccess.Internet) { _offlineManager = null; _offlineManager = OfflineManager.GetInstance(Application.Context); } }
static void OnConnectivityChanged(ConnectivityChangedEventArgs e) { if (currentAccess != e.NetworkAccess || !currentProfiles.SequenceEqual(e.ConnectionProfiles)) { SetCurrent(); MainThread.BeginInvokeOnMainThread(() => ConnectivityChangedInternal?.Invoke(null, e)); } }
private void Connectivity_ConnectivityChanged(object sender, Xamarin.Essentials.ConnectivityChangedEventArgs e) { if ((e.ConnectionProfiles.Contains(ConnectionProfile.WiFi) || e.ConnectionProfiles.Contains(ConnectionProfile.Cellular)) && e.NetworkAccess == NetworkAccess.Internet) { Device.BeginInvokeOnMainThread(() => { MakeChatRead(); }); GetFirebaseChatList(); } }
private async void ConnectivityChanged(Xamarin.Essentials.ConnectivityChangedEventArgs e) { if (Connectivity.NetworkAccess != NetworkAccess.Internet) { DependencyService.Get <IToast>().SendToast("网络不给你,请检查网络设置"); } else { await UserTokenSettings.Current.RefreshUserTokenAsync(); } }
private void Connectivity_ConnectivityChanged(object sender, Xamarin.Essentials.ConnectivityChangedEventArgs e) { var current = e.NetworkAccess; var profiles = e.Profiles; if (current == NetworkAccess.Internet) { MainViewModel.Instance.CheckConnectionAndUpdate(); } else { MainViewModel.Instance.IsNetworkOk = false; } }
private void Connectivity_ConnectivityChanged(object sender, Xamarin.Essentials.ConnectivityChangedEventArgs e) { if (e.NetworkAccess == Xamarin.Essentials.NetworkAccess.Internet) { SetIPAddressToIPLabel(); StartSocketListening(); } else { ShowFancyMessage(GetApplicationContext(), "No internet connection", Color: Resource.Color.error_color_material_light, Duration: 3500); SetIPAddressToIPLabel(); StartSocketListening(); } }
private void OnConnectivityChanged(object sender, Xamarin.Essentials.ConnectivityChangedEventArgs e) { ConnectivityChanged?.Invoke(this, new ConnectivityChangedEventArgs((NetworkAccessEnum)e.NetworkAccess, GetProfiles(e.Profiles))); }
private void ConnectivityChanged(object sender, Xamarin.Essentials.ConnectivityChangedEventArgs e) { MessagingCenter.Send(this, Constants.Message.CONNECTION_STATE_CHANGED, e); }
private void Connectivity_ConnectivityChanged(object sender, Xamarin.Essentials.ConnectivityChangedEventArgs e) { UpdateStatusNet(); }