Beispiel #1
0
 public void Reset()
 {
     OnScreenDisplayDropShadowColor = DefaultOnScreenDisplayDropShadowColor;
     OnScreenDisplayFadeSpeed       = DefaultOnScreenDisplayFadeSpeed;
     OnScreenDisplayForegroundColor = DefaultOnScreenDisplayForegroundColor;
     OnScreenDisplayTheme           = OnScreenDisplayThemes.DefaultTheme;
 }
Beispiel #2
0
        public void Load()
        {
            Reset();

            using (var isolatedStorageFile = IsolatedStorageFile.GetUserStoreForDomain())
            {
                if (isolatedStorageFile.FileExists(FileName))
                {
                    using (var isolatedStorageFileStream = isolatedStorageFile.OpenFile(FileName, FileMode.Open, FileAccess.Read, FileShare.Read))
                    {
                        var xmlSerializer = new XmlSerializer(typeof(Settings));
                        try
                        {
                            var loadedSettings = xmlSerializer.Deserialize(isolatedStorageFileStream) as Settings;

                            if (loadedSettings != null)
                            {
                                OnScreenDisplayDropShadowColor = loadedSettings.OnScreenDisplayDropShadowColor;
                                OnScreenDisplayFadeSpeed       = loadedSettings.OnScreenDisplayFadeSpeed;
                                OnScreenDisplayForegroundColor = loadedSettings.OnScreenDisplayForegroundColor;
                                OnScreenDisplayTheme           = loadedSettings.OnScreenDisplayTheme;
                            }
                        }
                        catch (Exception exception)
                        {
                            Logging.LogException(exception);
                        }
                    }
                }
            }
        }