public void Save(string filename = "") { if (!string.IsNullOrEmpty(filename)) { FileInfo = new FileInfo(filename); } // Save As... if (!string.IsNullOrEmpty(filename)) { _3dslz.Save(FileInfo.Create()); _3dslz.Close(); } else { // Create the temp file _3dslz.Save(File.Create(FileInfo.FullName + ".tmp")); _3dslz.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); }
public void Save(string filename = "") { if (!string.IsNullOrEmpty(filename)) { FileInfo = new FileInfo(filename); } if (MessageBox.Show("Use fixed offsets to save the file?", "Fixed Offsets?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { _3dslz.UseFixedOffsets = true; } // Save As... if (!string.IsNullOrEmpty(filename)) { _3dslz.Save(FileInfo.Create()); _3dslz.Close(); } else { // Create the temp file _3dslz.Save(File.Create(FileInfo.FullName + ".tmp")); _3dslz.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); }
public void Unload() { _3dslz?.Close(); }