Exemplo n.º 1
0
        private async void SetOnlineStatus()
        {
            SetNetworkControlsEnabledState(false);
            LabelStatus.Content = "Checking internet connection, please wait …";
            if (!await Task.Run(() => MiscTools.IsComputerOnline()))
            {
                LabelStatus.Content = "Computer is not online. All online functionality will be disabled.";
                await Task.Delay(5000);

                _online = false;
            }
            else
            {
                _online = true;
            }
            LabelStatus.Content = "Ready.";
            SetNetworkControlsEnabledState(true);
        }