void BtnExportCodeClick(object sender, EventArgs e) { string path = DoSaveFileDialog("Accepted File Types (*.cs)|*.cs|C# source files (*.cs)|*.cs"); if (path == null) { return; } using (FileStream fs = File.Create(path)) { ModelFormat.ExportCode(parts, fs); } }
void Import(Stream src) { parts = ModelFormat.Import(src); lbModels.Items.Clear(); foreach (RawPart part in parts) { lbModels.Items.Add(part.Name); } lbModels.SelectedIndex = 0; RebuildModel(); }