private PopulateElementSavesFromReferences ( string projectRootDirectory, |
||
projectRootDirectory | string | |
result | ||
Résultat | void |
public static GumProjectSave Load(string fileName, out string errors) { if (string.IsNullOrEmpty(fileName)) { errors = "Passed null file name, could not load GumProjectSave"; return(null); } GumProjectSave gps = null; #if ANDROID gps = LoadFromTitleStorage(fileName, out errors); #else if (System.IO.File.Exists(fileName)) { gps = FileManager.XmlDeserialize <GumProjectSave>(fileName); } else { errors = "The Gum project file does not exist"; } #endif string projectRootDirectory = FileManager.GetDirectory(fileName); gps.PopulateElementSavesFromReferences(projectRootDirectory, out errors); gps.FullFileName = fileName; return(gps); }
static GumProjectSave LoadFromTitleStorage(string fileName, GumLoadResult result) { using (System.IO.Stream stream = Microsoft.Xna.Framework.TitleContainer.OpenStream(fileName)) { GumProjectSave gps = FileManager.XmlDeserializeFromStream <GumProjectSave>(stream); string projectRootDirectory = FileManager.GetDirectory(fileName); gps.PopulateElementSavesFromReferences(projectRootDirectory, result); gps.FullFileName = fileName; return(gps); } }
public static GumProjectSave Load(string fileName, out GumLoadResult result) { result = new GumLoadResult(); if (string.IsNullOrEmpty(fileName)) { result.ErrorMessage = "Passed null file name, could not load GumProjectSave"; return(null); } if (FileManager.IsRelative(fileName)) { fileName = FileManager.MakeAbsolute(fileName); } GumProjectSave gps = null; #if ANDROID || IOS || WINDOWS_8 gps = LoadFromTitleStorage(fileName, result); #else try { gps = FileManager.XmlDeserialize <GumProjectSave>(fileName); } catch (FileNotFoundException) { result.MissingFiles.Add(fileName); return(null); } catch (IOException ex) { result.ErrorMessage = ex.Message; return(null); } #endif string projectRootDirectory = FileManager.GetDirectory(fileName); gps.PopulateElementSavesFromReferences(projectRootDirectory, result); gps.FullFileName = fileName.Replace('\\', '/'); return(gps); }