Exemple #1
0
        private void delClass_Click(object sender, RoutedEventArgs e)
        {
            BindingList <String> list = this.classlistView.ItemsSource as BindingList <String>;

            String           name   = classlistView.SelectedValue as String;
            MessageBoxResult result = MessageBox.Show(String.Format("是否删除'{0}'分类", name), "提示", MessageBoxButton.OKCancel, MessageBoxImage.Warning);

            if (result == MessageBoxResult.OK)
            {
                ///循环删除当前图元文件
                foreach (String varName in _iconData[name])
                {
                    ///删除对应的文件
                    String timeFile = _picManager.getFilePathFromName(varName);
                    String file     = Path.Combine(SVProData.IconPath, timeFile);
                    File.Delete(file);
                }

                _picManager.removeClass(name);
                list.Remove(name);

                ///保存文件数据
                saveIconInfo();
                iconRefresh();
            }
        }
Exemple #2
0
        /// <summary>
        /// 执行具体的移除分类操作
        /// </summary>
        /// <param oldName="sender"></param>
        /// <param oldName="e"></param>
        void removeClassItem_Click(object sender, EventArgs e)
        {
            ///如果当前没有选中分类节点,不做任何操作
            if (treeView.SelectedNode == null)
            {
                return;
            }

            ///如果当前分类不为空,不做任何操作
            if (!_pixmapManage.isEmptyClassfy(treeView.SelectedNode.Text))
            {
                SVMessageBox msgBox = new SVMessageBox();
                msgBox.content(Resource.提示, Resource.除图元分类);
                msgBox.ShowDialog();
                return;
            }

            _pixmapManage.removeClass(treeView.SelectedNode.Text);
            treeView.Nodes.Remove(treeView.SelectedNode);
            saveIconInfo();
        }