// //TreeView 双击事件 // private void trv_FixtureView_MouseDoubleClick(object sender, MouseButtonEventArgs e) { PropertyNodeItem t = (PropertyNodeItem)trv_FixtureView.SelectedItem; _W_FixtureInfo = t.Fixture; ShowFixture(t.Fixture); }
/// <summary> /// 加载治具视图 /// </summary> public void Lading_FixtureViws() { if (FixtrueInfo.Count > 0) { Maticsoft.Model.FixtureInfo _TemFixtureInfo = (Maticsoft.Model.FixtureInfo)FixtrueInfo[0]; if (FixtrueInfo.Count == 1) //如果只有一个总成 { //治具总名称 PropertyNodeItem node1 = new PropertyNodeItem() { DisplayName = _TemFixtureInfo.Assembly_Name, Name = "总成名称", Icon = TAG_ICON, Fixture = _TemFixtureInfo }; itemList.Add(node1); } else //如果总成下面有很多的治具 { //治具总名称 PropertyNodeItem node1 = new PropertyNodeItem() { DisplayName = _TemFixtureInfo.Assembly_Name, Name = "总成名称", Icon = TAG_ICON, Fixture = _TemFixtureInfo }; foreach (object Fixture in FixtrueInfo) { Maticsoft.Model.FixtureInfo _tem = (Maticsoft.Model.FixtureInfo)Fixture; PropertyNodeItem node1tag1 = new PropertyNodeItem() { DisplayName = _tem.Name, Name = _tem.BarCode, Icon = TAG_ICON, Fixture = _tem }; node1.Children.Add(node1tag1); } itemList.Clear(); itemList.Add(node1); SetControl_IsEn(false, false); } } else { My_MessageBox.My_MessageBox_Message("未找到治具信息!"); } }
// //右键菜单-删除 // private void Mei_Delete_Checked(object sender, RoutedEventArgs e) { if (trv_FixtureView.SelectedItem != null) { PropertyNodeItem t = (PropertyNodeItem)trv_FixtureView.SelectedItem; if (MCP_CS.FixtureInfo.Delete(t.Fixture.FAY_ID)) { My_MessageBox.My_MessageBox_Message("删除成功!"); FixtrueInfo = GetFixInfoList(_W_FixtureInfo); Lading_FixtureViws(); } else { My_MessageBox.My_MessageBox_Message("删除失败!"); } } else { My_MessageBox.My_MessageBox_Message("请选择需要删除的项!"); } }