コード例 #1
0
        private void AddButton_Click(object sender, EventArgs e)
        {
            PatternDefinition pattern
                = SettingFileAccessor.AddNewPatternDefinition(Application.StartupPath);

            patternList.Add(pattern);

            ShowPatternList();
        }
コード例 #2
0
        private void CloneButton_Click(object sender, EventArgs e)
        {
            if (PatternListBox.SelectedIndex == -1)
            {
                return;
            }

            PatternDefinition source = patternList[PatternListBox.SelectedIndex];

            PatternDefinition dest
                = SettingFileAccessor.CopyPatternDefinition(Application.StartupPath, source);

            patternList.Add(dest);

            ShowPatternList();
        }
コード例 #3
0
        private void DeleteButton_Click(object sender, EventArgs e)
        {
            if (PatternListBox.SelectedIndex == -1 ||
                PatternListBox.SelectedIndex > patternList.Count - 1)
            {
                return;
            }

            PatternDefinition target = patternList[PatternListBox.SelectedIndex];

            SettingFileAccessor.DeletePatternDefinition(Application.StartupPath, target);

            patternList.Remove(target);

            ShowPatternList();
        }
コード例 #4
0
        private void UpdateButton_Click(object sender, EventArgs e)
        {
            if (PatternListBox.SelectedIndex == -1)
            {
                return;
            }

            PatternDefinition target = patternList[PatternListBox.SelectedIndex];

            PatternDefinition updated = CreateEditingPattern(target);

            patternList.Insert(PatternListBox.SelectedIndex, updated);
            patternList.Remove(target);

            SettingFileAccessor.SavePatternDefinition(Application.StartupPath, updated);

            MessageBox.Show(Properties.Resources.MessageSaveSetting);

            ShowPatternList();
        }
コード例 #5
0
        private void NewProjectSettingDialog_Load(object sender, EventArgs e)
        {
            EncodingCombobox.SelectedIndex = 0;
            SelectedPattern = defaultPattern;

            PatternList = SettingFileAccessor.LoadPatternDefinitionList(Application.StartupPath);

            if (PatternList != null)
            {
                foreach (PatternDefinition pattern in PatternList)
                {
                    ListViewItem item = new ListViewItem(pattern.PatternName);
                    item.SubItems.Add(pattern.RegularExpression);

                    PatternListView.Items.Add(item);
                }

                if (PatternListView.Items.Count > 0)
                {
                    PatternListView.Items[0].Selected = true;
                }
            }
        }
コード例 #6
0
 private void AnalyzePatternSettingDialog_Load(object sender, EventArgs e)
 {
     patternList = SettingFileAccessor.LoadPatternDefinitionList(Application.StartupPath);
     ShowPatternList();
 }