public static void OpenFile(string filePath) { RemoveEvents(Data); Data = (STBLXMLFile)Tools.ReadXML <STBLXMLFile>(filePath); AddEvents(Data); FilePath = new IO.PathContainer(filePath).ToString(); SortEntries(); Data.IsDirtyable = true; for (int entryIndex = 0; entryIndex < Data.Entries.Count; entryIndex++) { Data.Entries[entryIndex].IsDirtyable = true; } InvokeFileChangedEvent(); }
public static void SaveFile(string filePath) { Tools.WriteXML(filePath, Data); IO.PathContainer newFilePath = new IO.PathContainer(filePath); IO.PathContainer oldFilePath = FilePath != null ? new IO.PathContainer(FilePath) : null; if (newFilePath != oldFilePath) { FilePath = new IO.PathContainer(filePath).ToString(); } for (int entryIndex = 0; entryIndex < Data.Entries.Count; entryIndex++) { Data.Entries[entryIndex].EntryIsDirty = false; } Data.FileIsDirty = false; if (newFilePath != oldFilePath) { InvokeFileChangedEvent(); } }