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_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();
            }
        }