コード例 #1
0
        public void Load()
        {
            if (!_isoStoreInit)
            {
                return;
            }

            try
            {
                if (_isoStore.FileExists(SettingsPath))
                {
                    using (var isoStream = new IsolatedStorageFileStream(SettingsPath, FileMode.Open, _isoStore))
                    {
                        using (var reader = new StreamReader(isoStream))
                        {
                            var serializer = new XmlSerializer(typeof(PipelineSettings));
                            Default = (PipelineSettings)serializer.Deserialize(reader);

                            var history = Default.ProjectHistory.ToArray();
                            foreach (var h in history)
                            {
                                if (!File.Exists(h))
                                {
                                    Default.ProjectHistory.Remove(h);
                                }
                            }
                        }
                    }
                }
            }
            catch
            {
                Save();
            }
        }
コード例 #2
0
 public void Load()
 {
     if (_isoStore.FileExists(SettingsPath))
     {
         using (var isoStream = new IsolatedStorageFileStream(SettingsPath, FileMode.Open, _isoStore))
         {
             using (var reader = new StreamReader(isoStream))
             {
                 var serializer = new XmlSerializer(typeof(PipelineSettings));
                 Default = (PipelineSettings)serializer.Deserialize(reader);
             }
         }
     }
 }
コード例 #3
0
        public void Load()
        {
            if (!_isoStoreInit)
            {
                return;
            }

            try
            {
                if (!_isoStore.FileExists(SettingsPath))
                {
                    return;
                }

                using var isoStream = new IsolatedStorageFileStream(
                          SettingsPath, FileMode.Open, _isoStore);

                using var reader = new XmlTextReader(isoStream);
                var serializer = new XmlSerializer(typeof(PipelineSettings));
                Default = (PipelineSettings)serializer.Deserialize(reader);

                for (int i = Default.ProjectHistory.Count; i-- > 0;)
                {
                    string entry = Default.ProjectHistory[i];

                    if (!File.Exists(entry))
                    {
                        Default.ProjectHistory.RemoveAt(i);
                    }
                }
            }
            catch
            {
                Save();
            }
        }
コード例 #4
0
 static PipelineSettings()
 {
     Default = new PipelineSettings();
 }
コード例 #5
0
ファイル: PipelineSettings.cs プロジェクト: Zodge/MonoGame
        public void Load()
		{
            if (_isoStore.FileExists(SettingsPath))
            {
                using (var isoStream = new IsolatedStorageFileStream(SettingsPath, FileMode.Open, _isoStore))
                {
                    using (var reader = new StreamReader(isoStream))
                    {
                        var serializer = new XmlSerializer(typeof(PipelineSettings));
                        Default = (PipelineSettings)serializer.Deserialize(reader);
                    }
                }
            }
        }
コード例 #6
0
ファイル: PipelineSettings.cs プロジェクト: Zodge/MonoGame
 static PipelineSettings()
 {
     Default = new PipelineSettings();
 }