public static void MA3EntryWriter(string filename, LMTM3AEntry entrytowrite) { try { using (BinaryWriter bw = new BinaryWriter(File.Open(filename, FileMode.Create))) { bw.Write(entrytowrite.FullData); bw.Close(); } } catch (UnauthorizedAccessException) { MessageBox.Show("Unable to access the file. Maybe it's already in use by another proccess?", "Cannot write this file."); return; } }
public static void MA3EntryWriter(string filename, LMTM3AEntry entrytowrite) { try { using (BinaryWriter bw = new BinaryWriter(File.Open(filename, FileMode.Create))) { bw.Write(entrytowrite.FullData); bw.Close(); } } catch (Exception ex) { ExceptionCatchAll(ex); return; } }
public static void KeyFrameWriter(string filename, LMTM3AEntry entrytowrite) { try { //Time to start getting the data from the M3A Entry. For Testing Purposes. using (StreamWriter sw = new StreamWriter(File.Open(filename, FileMode.Create))) { var serializer = new SerializerBuilder().DisableAliases().EnsureRoundtrip().WithTagMapping("!LMTM3AEntry", typeof(ThreeWorkTool.Resources.Wrappers.LMTM3AEntry)).Build(); // Save Changes serializer.Serialize(sw, entrytowrite); } } catch (UnauthorizedAccessException) { MessageBox.Show("Unable to access the file. Maybe it's already in use by another proccess?", "Cannot write this file."); return; } }
public static void KeyFrameWriter(string filename, LMTM3AEntry entrytowrite) { try { //Prepares the Keyframes. entrytowrite = LMTM3AEntry.PrepareTheKeyframes(entrytowrite); //Time to start getting the data from the M3A Entry. For Testing Purposes. using (StreamWriter sw = new StreamWriter(File.Open(filename, FileMode.Create))) { var serializer = new SerializerBuilder().DisableAliases().EnsureRoundtrip().WithTagMapping("!LMTM3AEntry", typeof(ThreeWorkTool.Resources.Wrappers.LMTM3AEntry)).Build(); // Save Changes serializer.Serialize(sw, entrytowrite); } } catch (Exception ex) { ExceptionCatchAll(ex); return; } }