コード例 #1
0
ファイル: Splash.xaml.cs プロジェクト: wanglong0303/Dopamine
        private async Task <bool> InitializeSettingsAsync()
        {
            bool isSuccess = false;

            try
            {
                // Checks if an upgrade of the settings is needed
                if (SettingsClient.IsUpgradeNeeded())
                {
                    this.ShowProgressRing = true;
                    LogClient.Info("Upgrading settings");
                    await Task.Run(() => SettingsClient.Upgrade());
                }

                isSuccess = true;
            }
            catch (Exception ex)
            {
                LogClient.Error("There was a problem initializing the settings. Exception: {0}", ex.Message);
                this.errorMessage = ex.Message;
                isSuccess         = false;
            }

            return(isSuccess);
        }