Beispiel #1
0
        private void editMatClick(object sender, RoutedEventArgs e)
        {
            // 编辑mat参数
            if (gatherDataFromEditWindow == null)
            {
                e.Handled = true;
                System.Windows.MessageBox.Show("请先选择材料强度模型!", "警告");
                return;
            }
            EditMaterialAttrWindow      edaw    = new EditMaterialAttrWindow();
            Dictionary <string, string> matData = gatherDataFromEditWindow["mat"];

            edaw.PassValuesEvent += new EditMaterialAttrWindow.PassValuesHandler(receivedEditMatWindowData);
            edaw.setMat(matData);
            edaw.Topmost = true;
            edaw.Show();
        }
 // 双击ListBoxItem_soeName进入该材料的编辑界面
 private void updateSoe(object sender, RoutedEventArgs e)
 {
     if (curdType == "u" && ((System.Windows.Controls.ListBoxItem)sender).Content.ToString() != "")
     {
         currentClickRowOfListBox = listBox_soeName.SelectedIndex;
         EditMaterialAttrWindow edaw = new EditMaterialAttrWindow();
         // 如果已经修改过其他两个属性,则不去new
         if (currentMaterial == null)
         {
             currentMaterial = new Dictionary <string, Dictionary <string, string> >(findFromDataBaseMaterials[currentClickRowOfListBox]);
         }
         Dictionary <string, string> soeData = new Dictionary <string, string>(currentMaterial["soe"]);
         edaw.PassValuesEvent += new EditMaterialAttrWindow.PassValuesHandler(ReceivedVals);
         edaw.setSoe(soeData);
         edaw.Topmost = true;
         edaw.Show();
     }
 }
 // 双击ListBoxItem_materialName进入该材料的编辑界面
 private void updateMaterialName(object sender, RoutedEventArgs e)
 {
     if (curdType == "u")
     {
         currentClickRowOfListBox = listBox_materialName.SelectedIndex; // 从0开始索引
         // 改变currentMaterial,未改变findFromDataBaseMaterials
         // 如果已经修改过其他两个属性,则不去new
         if (currentMaterial == null)
         {
             currentMaterial = new Dictionary <string, Dictionary <string, string> >(findFromDataBaseMaterials[currentClickRowOfListBox]);
         }
         string materialName         = currentMaterial["materialName"]["content"];
         string refer                = currentMaterial["refer"]["content"];
         EditMaterialAttrWindow edaw = new EditMaterialAttrWindow();
         edaw.setMaterialName(materialName, refer);
         edaw.Topmost          = true;
         edaw.PassValuesEvent += new EditMaterialAttrWindow.PassValuesHandler(ReceivedVals);
         edaw.Show();
     }
 }
        // 双击ListBoxItem_matName进入该材料的编辑界面
        private void updateMat(object sender, RoutedEventArgs e)
        {
            ListBoxItem listBoxItem = sender as ListBoxItem;

            if (curdType == "u")
            {
                int _index = Convert.ToInt32(listBoxItem.Tag);
                currentClickRowOfListBox = listBox_matName.SelectedIndex;
                EditMaterialAttrWindow edaw = new EditMaterialAttrWindow();
                // 如果已经修改过其他两个属性,则不去new
                if (currentMaterial == null)
                {
                    currentMaterial = new Dictionary <string, Dictionary <string, string> >(findFromDataBaseMaterials[_index]);
                }
                Dictionary <string, string> matData = new Dictionary <string, string>(currentMaterial["mat"]);
                edaw.PassValuesEvent += new EditMaterialAttrWindow.PassValuesHandler(ReceivedVals);
                edaw.setMat(matData);
                edaw.Topmost = true;
                edaw.Show();
            }
        }