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