コード例 #1
0
        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();
        }
コード例 #2
0
        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();
            }
        }