Geowigo.Models.CartridgeTag.ImportSavegamesCache C# (CSharp) Method

ImportSavegamesCache() private method

private ImportSavegamesCache ( IsolatedStorageFile isf ) : void
isf System.IO.IsolatedStorage.IsolatedStorageFile
return void
        private void ImportSavegamesCache(IsolatedStorageFile isf)
        {
            List<CartridgeSavegame> cSavegames = new List<CartridgeSavegame>();
            
            string[] gwsFiles = isf.GetFileNames(PathToSavegames + "/*.gws");
            if (gwsFiles != null)
            {
                // For each file, imports its metadata.
                foreach (string file in gwsFiles)
                {
                    string path = PathToSavegames + "/" + file;
                    try
                    {
                        cSavegames.Add(CartridgeSavegame.FromIsoStore(path, isf));
                    }
                    catch (FileNotFoundException)
                    {
                        // No associated meta-data or the file does not exist.
                        // Let the store decide what to do.
                        App.Current.Model.CartridgeStore.OnUnknownSavegame(path);
                    }
                    catch (Exception ex)
                    {
                        // Outputs the exception.
                        System.Diagnostics.Debug.WriteLine("CartridgeTag: WARNING: Exception during savegame import.");
                        DebugUtils.DumpException(ex);
                    }
                }
            }

            // Sets the savegame list.
            _savegames.AddRange(cSavegames);
            RaisePropertyChanged("Savegames");
        }