Beispiel #1
0
        public void Save(string filename = "")
        {
            if (!string.IsNullOrEmpty(filename))
            {
                FileInfo = new FileInfo(filename);
            }

            // Save As...
            if (!string.IsNullOrEmpty(filename))
            {
                _ctpk.Save(FileInfo.Create());
                _ctpk.Close();
            }
            else
            {
                // Create the temp file
                _ctpk.Save(File.Create(FileInfo.FullName + ".tmp"));
                _ctpk.Close();
                // Delete the original
                FileInfo.Delete();
                // Rename the temporary file
                File.Move(FileInfo.FullName + ".tmp", FileInfo.FullName);
            }

            // Reload the new file to make sure everything is in order
            Load(FileInfo.FullName);
        }
Beispiel #2
0
 public void Unload()
 {
     _ctpk?.Close();
 }