/// <summary> /// Saves the current file as .bgf or .xml/.bmp /// </summary> /// <param name="Filename"></param> public static void Save(string Filename) { // set values in file from input controls in 'settings' window CurrentFile.ShrinkFactor = SettingsForm.ShrinkFactor; CurrentFile.Version = SettingsForm.Version; CurrentFile.Name = SettingsForm.BgfName; string extension = Path.GetExtension(Filename); switch (extension) { case FileExtensions.BGF: if (SettingsForm.IsSaveCompresed) { CurrentFile.CompressAll(); } else { CurrentFile.DecompressAll(); } CurrentFile.Save(Filename); break; case FileExtensions.XML: CurrentFile.WriteXml(Filename); break; } }
/// <summary> /// Load a BGF from .bgf or .xml /// </summary> /// <param name="Filename">Full path and filename of BGF or XML</param> public static void Load(string Filename) { if (File.Exists(Filename)) { string extension = Path.GetExtension(Filename).ToLower(); switch (extension) { case FileExtensions.BGF: CurrentFile.Load(Filename); CurrentFile.DecompressAll(); break; case FileExtensions.XML: CurrentFile.LoadXml(Filename); break; } // set input controls in 'settings' window to values from file SettingsForm.ShrinkFactor = CurrentFile.ShrinkFactor; SettingsForm.Version = CurrentFile.Version; SettingsForm.BgfName = CurrentFile.Name; // set mainoverlay resource to loaded file RoomObject.OverlayFile = CurrentFile.Filename + ".bgf"; RoomObject.Resource = CurrentFile; } }
/// <summary> /// Load a BGF from .bgf or .xml /// </summary> /// <param name="Filename">Full path and filename of BGF or XML</param> public static void Load(string Filename) { // stop animation playback Program.IsPlaying = false; MainForm.btnPlay.Image = Properties.Resources.Play; if (File.Exists(Filename)) { string extension = Path.GetExtension(Filename).ToLower(); switch (extension) { case FileExtensions.BGF: CurrentFile.Load(Filename); CurrentFile.DecompressAll(); break; case FileExtensions.XML: CurrentFile.LoadXml(Filename); break; } // set input controls in 'settings' window to values from file SettingsForm.ShrinkFactor = CurrentFile.ShrinkFactor; SettingsForm.Version = CurrentFile.Version; SettingsForm.BgfName = CurrentFile.Name; } }
/// <summary> /// Load a BGF from .bgf or .xml /// </summary> /// <param name="Filename">Full path and filename of BGF or XML</param> public static void Load(string Filename) { if (File.Exists(Filename)) { string extension = Path.GetExtension(Filename); switch (extension) { case FileExtensions.BGF: CurrentFile.Load(Filename); CurrentFile.DecompressAll(); break; case FileExtensions.XML: CurrentFile.LoadXml(Filename); break; } } }
/// <summary> /// Load a BGF from .bgf or .xml /// </summary> /// <param name="Filename">Full path and filename of BGF or XML</param> public static void Load(string Filename) { if (File.Exists(Filename)) { string extension = Path.GetExtension(Filename).ToLower(); switch (extension) { case FileExtensions.BGF: CurrentFile.Load(Filename); CurrentFile.DecompressAll(); break; case FileExtensions.XML: CurrentFile.LoadXml(Filename); break; } SetLoadedBgfProperties(); HasFileChanged = false; } }