private void OutputRuleFolderBox_MouseDoubleClick(object sender, MouseEventArgs e) { OutputFolderBrowserDialog.Reset(); OutputFolderBrowserDialog.Description = @"Выберите папку для её дальнейшего обслуживания."; DialogResult folderDialogResult = OutputFolderBrowserDialog.ShowDialog(); if (folderDialogResult != DialogResult.OK || string.IsNullOrWhiteSpace(OutputFolderBrowserDialog.SelectedPath)) { return; } if ( FoldersRulesCollection.FoldersRulesList[_indexInputFolder].RulesDictionary.Exists(x => x.OutputFolderPath == OutputFolderBrowserDialog.SelectedPath) && FoldersRulesCollection.FoldersRulesList[_indexInputFolder].RulesDictionary[_indexOutputFolder].OutputFolderPath != OutputFolderBrowserDialog.SelectedPath) { MessageBox.Show(@"Данная папка уже содержится в списке.", @"Повторное добавление папки!", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { if (FoldersRulesCollection.FoldersRulesList[_indexInputFolder].RulesDictionary.Count <= _indexOutputFolder) { FoldersRulesCollection.FoldersRulesList[_indexInputFolder].RulesDictionary.Add(new FoldersRulesCollection.FoldersRulesItem.RulesDictionaryItem(OutputFolderBrowserDialog.SelectedPath, false, new List <FoldersRulesCollection.FoldersRulesItem.RulesDictionaryItem.ValuesItem>())); } else { FoldersRulesCollection.FoldersRulesList[_indexInputFolder].RulesDictionary[_indexOutputFolder].OutputFolderPath = OutputFolderBrowserDialog.SelectedPath; } OutputRuleFolderBox.Text = OutputFolderBrowserDialog.SelectedPath; } }
private void BtnSelectOutputFolderClick(object sender, EventArgs e) { var dialogResult = OutputFolderBrowserDialog.ShowDialog(); if (dialogResult == DialogResult.OK) { PathToOutputFolder = OutputFolderBrowserDialog.SelectedPath; } }