示例#1
0
        private void DropMI_Click(object sender, RoutedEventArgs e)
        {
            var add = new AddLabelWindow();

            try
            {
                var a    = (LKV)_dgValueList.SelectedItem;
                int kvid = -1;
                for (int i = 0; i < CSFFile.Label.Count; i++)
                {
                    if (CSFFile.Label[i].LabelString == a.Key)
                    {
                        kvid = i;
                    }
                }
                if (kvid == -1)
                {
                    throw new NullReferenceException();
                }
                CSFFile.DropLabel(CSFFile.Label[kvid]);
            }
            catch (NullReferenceException)
            {
                MessageBox.Show("未选择");
                return;
            }
        }
示例#2
0
        private void AddMI_Click(object sender, RoutedEventArgs e)
        {
            var add = new AddLabelWindow();
            var ret = add.ShowDialog(new CSFEditor.Label(), AddLabelWindow.EditMode.Add);

            CSFFile.AddLabel(ret);
        }