BaconographyWP8.PlatformServices.SystemServices.networkStatusChanged C# (CSharp) Method

networkStatusChanged() private method

private networkStatusChanged ( object sender ) : void
sender object
return void
        private void networkStatusChanged(object sender)
        {
            var connectionProfile = NetworkInformation.GetInternetConnectionProfile();
            var connectionCostType = connectionProfile.GetConnectionCost().NetworkCostType;
            if (connectionCostType == NetworkCostType.Unknown || connectionCostType == NetworkCostType.Unrestricted)
                IsOnMeteredConnection = false;
            else
                IsOnMeteredConnection = true;

            IsNearingDataLimit = connectionProfile.GetConnectionCost().ApproachingDataLimit || connectionProfile.GetConnectionCost().OverDataLimit || connectionProfile.GetConnectionCost().Roaming;
        }