public static void SavePnc(PNCInfo info, string fileName) { using (FileStream fs = new FileStream(fileName, FileMode.Create, FileAccess.Write)) { XmlSerializer serializer = new XmlSerializer(typeof(PNCInfo)); serializer.Serialize(fs, info); } }
private void LoadPnc() { pncInfo = PNCHelper.LoadPnc(setting.FilePath); this.bindingSourceCnc.DataSource = pncInfo.Holes; this.bindingSourceParam.DataSource = pncInfo.Params; this.bindingSourceParam.DataMember = this.tabE.SelectedTabPage.Text == L.R("FormMain.Throw", "穿透") ? L.R("FormMain.Manual", "手动") : this.tabE.SelectedTabPage.Text; this.bindingSourceThrowSet.DataSource = pncInfo.ThrowSet; fileName = setting.FilePath; //this.biFileName.Caption = File.Exists(setting.FilePath) ? setting.FilePath : ""; this.gcFileName.Text = string.Format(L.R("FormMain.HoleList", "加工孔位列表{0}"), fileName == "" ? "" : "(" + fileName + ")"); this.isChanged = false; }