private void toolStripButton1_Click(object sender, EventArgs e) { Demo.USTViewer.BarkUST bu = new Demo.USTViewer.BarkUST(); ObjectDeserializer <ProjectObject> DPO = new ObjectDeserializer <ProjectObject>(); BasicFileInformation bfi = DPO.ReadBasicInformation(bu.GetCacheFile()); if (bfi.SavePassword.Length > 0 || bfi.IntroduceText.Trim().Length > 0) { IntroduceSwap ISW = new IntroduceSwap(bfi); if (ISW.ShowDialog() != DialogResult.OK) { return; } } try { ProjectObject OOP = DPO.DeserializeFromFile(bu.GetCacheFile(), bfi, ObjectSerializer <ProjectObject> .SerializeType.JSON, true); LoadProject(ref OOP); } catch (Exception ew) { if (ew.Message == "Password Error or File Broken") { MessageBox.Show("密码错误!"); } else { MessageBox.Show("未知错误!"); } } }
public Form2() { InitializeComponent(); BarkUST bu = new BarkUST(); poj = bu.GetTest(true); OAC.ReAlloc(poj); }
private void MainWindow_Load(object sender, EventArgs e) { Demo.USTViewer.BarkUST bu = new Demo.USTViewer.BarkUST(); /* ProjectObject poj = new ProjectObject(); * poj.InitEmpty();*/ ProjectObject poj = bu.GetTest(false); PartsObject PO = poj.TrackerList[0].PartList[0]; sw.ShowOnDock(this.MainDock); aw.ShowOnDock(this.MainDock); tw.ShowOnDock(this.MainDock); tw.BindAttributeWindow(aw); sw.BindAttributeWindow(aw); tw.ShowingEditorChanged += tw_ShowingEditorChanged; tw.SelectingPartChanged += tw_SelectingPartChanged; tw.TotalTimePosChange += tw_TotalTimePosChange; sw.TotalTimePosChange += sw_TotalTimePosChange; LoadProject(ref poj); }