private void AddButton_Click(object sender, EventArgs e) { PatternDefinition pattern = SettingFileAccessor.AddNewPatternDefinition(Application.StartupPath); patternList.Add(pattern); ShowPatternList(); }
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(); }
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(); }
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(); }
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; } } }
private void AnalyzePatternSettingDialog_Load(object sender, EventArgs e) { patternList = SettingFileAccessor.LoadPatternDefinitionList(Application.StartupPath); ShowPatternList(); }