예제 #1
0
        private void btnAddSurface_Click(object sender, RoutedEventArgs e)
        {
            TemplateSurface tSurf  = new TemplateSurface(null, pObjTemplate.ParamNames);
            bool?           result = tSurf.ShowDialog();

            if (result == true)
            {
                pObjTemplate.Children.Add((tSurf.Tag as ParameterObjectTemplate));
                lbxSurfaceList.Items.Add((tSurf.Tag as ParameterObjectTemplate).name);
            }
        }
예제 #2
0
        private void btnEditSurface_Click(object sender, RoutedEventArgs e)
        {
            if (pObjTemplate.Children == null || pObjTemplate.Children.Count == 0)
            {
                return;
            }
            int index = lbxSurfaceList.SelectedIndex;

            if (index >= 0)
            {
                TemplateSurface tSurf  = new TemplateSurface(pObjTemplate.Children[index], pObjTemplate.ParamNames);
                bool?           result = tSurf.ShowDialog();
                if (result == true)
                {
                    pObjTemplate.Children[index] = tSurf.Tag as ParameterObjectTemplate;
                    lbxSurfaceList.Items.RemoveAt(index);
                    lbxSurfaceList.Items.Insert(index, (tSurf.Tag as ParameterObjectTemplate).name);
                }
            }
        }