示例#1
0
        private void OpenFilesBtnClick(object sender, EventArgs e)
        {
            using (var fileDialog = new OpenFileDialog {
                Multiselect = true
            })
            {
                if (fileDialog.ShowDialog() == DialogResult.OK)
                {
                    if (_localizationManager.HasResource(boxFileList, "Text"))
                    {
                        _localizationManager.CleanResource(boxFileList, "Text");
                        boxFileList.Clear();

                        _localizationManager.ApplyResource(btnChooseFiles, "Text", "AddFiles");
                    }

                    foreach (var fileName in fileDialog.FileNames)
                    {
                        var textFile = new TextFile(fileName);
                        _inputFiles.Add(textFile);
                        boxFileList.AppendText(textFile + Environment.NewLine);
                    }
                }
            }
        }