示例#1
0
 private void Connectivity_ConnectivityChanged(object sender, Xamarin.Essentials.ConnectivityChangedEventArgs e)
 {
     if (e.NetworkAccess != NetworkAccess.Internet)
     {
         _offlineManager = null;
         _offlineManager = OfflineManager.GetInstance(Application.Context);
     }
 }
示例#2
0
 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();
     }
 }
示例#4
0
 private async void ConnectivityChanged(Xamarin.Essentials.ConnectivityChangedEventArgs e)
 {
     if (Connectivity.NetworkAccess != NetworkAccess.Internet)
     {
         DependencyService.Get <IToast>().SendToast("网络不给你,请检查网络设置");
     }
     else
     {
         await UserTokenSettings.Current.RefreshUserTokenAsync();
     }
 }
示例#5
0
        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;
            }
        }
示例#6
0
 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();
     }
 }
示例#7
0
 private void OnConnectivityChanged(object sender, Xamarin.Essentials.ConnectivityChangedEventArgs e)
 {
     ConnectivityChanged?.Invoke(this, new ConnectivityChangedEventArgs((NetworkAccessEnum)e.NetworkAccess, GetProfiles(e.Profiles)));
 }
示例#8
0
 private void ConnectivityChanged(object sender, Xamarin.Essentials.ConnectivityChangedEventArgs e)
 {
     MessagingCenter.Send(this, Constants.Message.CONNECTION_STATE_CHANGED, e);
 }
示例#9
0
 private void Connectivity_ConnectivityChanged(object sender, Xamarin.Essentials.ConnectivityChangedEventArgs e)
 {
     UpdateStatusNet();
 }