BeFriend.ViewModel.BaseViewModel.UniversalSettingsRetriever C# (CSharp) Метод

UniversalSettingsRetriever() приватный Метод

private UniversalSettingsRetriever ( ) : void
Результат void
        private async void UniversalSettingsRetriever()
        {
            try
            {
               var applicationData = ApplicationData.Current;
                var localsettings = applicationData.LocalSettings;
                if (localsettings.Values.ContainsKey("UserName"))
                    _userName = localsettings.Values["UserName"] as string;
                if (localsettings.Values.ContainsKey("ThemeColorPrimary"))
                {
                    _themeColorPrimary = localsettings.Values["ThemeColorPrimary"] as string;
                    _themeColorSecondary = localsettings.Values["ThemeColorSecondary"] as string;
                }
                else
                {
                    localsettings.Values.Add("ThemeColorPrimary", "#237ba0");
                    localsettings.Values.Add("ThemeColorSecondary", "#70c1b4");
                    _themeColorPrimary = localsettings.Values["ThemeColorPrimary"] as string;
                    _themeColorSecondary = localsettings.Values["ThemeColorSecondary"] as string;
                }
                IsProgressBarEnabled = false;
                IsProgressBarVisibile = Visibility.Collapsed;
                RaisePropertyChangedBase();
            }
            catch (Exception exception)
            {
                Debug.WriteLine(exception);
            }

            try
            {
                var quotesFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri(@"ms-appx:///Quotes.txt"));

                var lines = File.ReadAllLines(quotesFile.Path);

                var rand = new Random();

                CommandBarQuote = lines[rand.Next(lines.Length)];

                RaisePropertyChanged(() => CommandBarQuote);
            }
            catch (Exception exception)
            {
                Debug.WriteLine(exception);
            }
            
        }