Cirrious.MvvmCross.Plugins.Network.Touch.MvxReachability.IsNetworkAvaialable C# (CSharp) Method

IsNetworkAvaialable() private static method

private static IsNetworkAvaialable ( NetworkReachabilityFlags &flags ) : bool
flags NetworkReachabilityFlags
return bool
        private static bool IsNetworkAvaialable(out NetworkReachabilityFlags flags)
        {
            if (defaultRouteReachability == null)
            {
                defaultRouteReachability = new NetworkReachability(new IPAddress(0));
#warning Need to look at SetNotification instead - ios6 change
                defaultRouteReachability.SetNotification(OnChange);
                defaultRouteReachability.Schedule(CFRunLoop.Current, CFRunLoop.ModeDefault);
            }
            if (defaultRouteReachability.TryGetFlags(out flags))
                return false;
            return IsReachableWithoutRequiringConnection(flags);
        }