internal static void ClearList(Form1 form, SearchInFilesPanel panel) { ListBox searchInFilesListBox = panel.searchInFilesListBox; if (WindowManager.ShowQuestionCancelBox(form, LanguageUtil.GetCurrentLanguageString("SureToClean", className)) == DialogResult.Yes) { searchInFilesListBox.Items.Clear(); } }
internal static void CopyFileFullPath(SearchInFilesPanel panel) { ListBox searchInFilesListBox = panel.searchInFilesListBox; foreach (object selectedItem in searchInFilesListBox.SelectedItems) { Clipboard.SetDataObject(GetFileCompletePathName(panel, selectedItem.ToString()), true, ConstantUtil.clipboardRetryTimes, ConstantUtil.clipboardRetryDelay); } }
internal static void OpenSelectedFileItem(Form1 form, SearchInFilesPanel panel) { ListBox searchInFilesListBox = panel.searchInFilesListBox; String[] selectedFiles = new String[searchInFilesListBox.SelectedItems.Count]; for (int i = 0; i < searchInFilesListBox.SelectedItems.Count; i++) { object selectedItem = searchInFilesListBox.SelectedItems[i]; selectedFiles[i] = GetFileCompletePathName(panel, selectedItem.ToString()); //pathBaseToolStripLabel.Text + selectedItem.ToString().Substring(2); } FileManager.OpenFile(form, form.TabIdentity, selectedFiles); }
internal static void ExportList(Form1 form, SearchInFilesPanel panel) { ListBox searchInFilesListBox = panel.searchInFilesListBox; XtraTabControl pagesTabControl = form.pagesTabControl; CustomRichTextBox pageTextBox = ProgramUtil.GetPageTextBox(pagesTabControl.SelectedTabPage); //String result = String.Empty; //foreach (object item in searchInFilesListBox.Items) //{ // result += GetFileCompletePathName(panel, item.ToString()) + ConstantUtil.newLine; //} String result = searchInFilesListBox.Items.Cast <object>().Aggregate(String.Empty, (current, item) => current + (GetFileCompletePathName(panel, item.ToString()) + ConstantUtil.newLine)); if (TabManager.IsCurrentTabInUse(form)) { form.TabIdentity = TabManager.AddNewPage(form, form.TabIdentity); pageTextBox = ProgramUtil.GetPageTextBox(pagesTabControl.SelectedTabPage); } pageTextBox.SelectedText = result; }
internal static String GetFileCompletePathName(SearchInFilesPanel panel, String shortFileName) { ToolStripLabel pathBaseToolStripLabel = panel.pathBaseToolStripLabel; return(Path.Combine(pathBaseToolStripLabel.Text, shortFileName)); //.Substring(2); }