private void browseButton_Click(object sender, EventArgs e) { browseFileDialog.Filter = "*.*|*.*"; if (browseFileDialog.ShowDialog() == DialogResult.OK) { filePathTextBox.Text = FileListUtils.MakeFileList(browseFileDialog.FileNames); } }
void IViewEvents.OnBrowseFilesButtonClicked() { char[] wildcardsChars = { '*', '?' }; var concretePatterns = new StringBuilder(); var wildcardsPatterns = new StringBuilder(); foreach (string s in factory.SupportedPatterns) { StringBuilder buf = null; if (s.IndexOfAny(wildcardsChars) >= 0) { if (s != "*.*" && s != "*") { buf = wildcardsPatterns; } } else { buf = concretePatterns; } if (buf != null) { buf.AppendFormat("{0}{1}", buf.Length == 0 ? "" : "; ", s); } } StringBuilder filter = new StringBuilder(); if (concretePatterns.Length > 0) { filter.AppendFormat("{0}|{0}|", concretePatterns.ToString()); } if (wildcardsPatterns.Length > 0) { filter.AppendFormat("{0}|{0}|", wildcardsPatterns.ToString()); } filter.Append("*.*|*.*"); var fnames = fileDialogs.OpenFileDialog(new OpenFileDialogParams() { Filter = filter.ToString(), CanChooseFiles = true, AllowsMultipleSelection = true, CanChooseDirectories = false, }); if (fnames != null) { view.WriteControlValue(ControlId.FileSelector, FileListUtils.MakeFileList(fnames).ToString()); } }
void IPagePresenter.Apply() { string tmp = view.InputValue.Trim(); if (tmp == "") { return; } view.InputValue = ""; preprocessingManager.Preprocess( FileListUtils.ParseFileList(tmp).Select(arg => preprocessingStepsFactory.CreateLocationTypeDetectionStep(new PreprocessingStepParams(arg))), "Processing selected files" ); }
void ApplyIndependentLogsMode() { string tmp = ((string)view.ReadControlValue(ControlId.FileSelector)).Trim(); if (tmp == "") { return; } view.WriteControlValue(ControlId.FileSelector, ""); foreach (string fname in FileListUtils.ParseFileList(tmp)) { try { model.Create(factory, factory.CreateParams(fname)); } catch (Exception e) { alerts.ShowPopup("Error", string.Format("Failed to create log source for '{0}': {1}", fname, e.Message), AlertFlags.Ok | AlertFlags.WarningIcon); break; } } }