示例#1
0
        public App()
        {
            InitializeComponent();

            _ = _internetCheck.CheckInternetAsync();

            Distribute.UpdateTrack = UpdateTrack.Private;
            AppCenter.Start(Secrets.analytics,
                            typeof(Analytics), typeof(Crashes), typeof(Distribute));

            MainPage = new LoginPage(_internetCheck);
        }
示例#2
0
        public static async Task <bool> CkeckConnectionAsync()
        {
            if (_conn?.State == ConnectionState.Closed)
            {
                try
                {
                    await _conn.OpenAsync();
                }
                catch (SqlException)
                {
                    await HelperFunctions.ShowAlertAsync("Couldn't connect to the database!", true);

                    return(false);
                }

                return(true);
            }

            while (_conn?.State == ConnectionState.Connecting)
            {
                await Task.Delay(100);
            }

            return(await _internetCheck.CheckInternetAsync().ConfigureAwait(false));
        }