public MainForm() { InitializeComponent(); columnHeaderFileName.Tag = new TextComparer<SearchFileInfo>(s => Path.GetFileName(s.Path)); columnHeaderDirectory.Tag = new TextComparer<SearchFileInfo>(s => Path.GetDirectoryName(s.Path)); columnHeaderModifyDate.Tag = new DateTimeComparer<SearchFileInfo>(s => s.LastWriteTime); columnHeaderSize.Tag = new Int64Comparer<SearchFileInfo>(s => s.Length); columnHeaderSearchTextHits.Tag = new TextComparer<SearchFileInfo>(s => s.SearchTexts); // Create an instance of a ListView column sorter and assign it to the ListView control. lvwColumnSorter = new ListViewColumnSorter(); lvwColumnSorter.CompareItems += new EventHandler<ListViewColumnSorterCompareEventArgs>(lvwColumnSorter_CompareItems); this.listViewResults.ListViewItemSorter = lvwColumnSorter; searchEngine = new SearchEngine(); searchEngine.SearchingPath += new EventHandler<SearchEventArgs>(SearchEngineSearchingPath); searchEngine.SearchFound += new EventHandler<SearchFoundEventArgs>(SearchEngineSearchFound); // Apply settings to combo boxes Properties.Settings.Default.DirectoryItems = ApplyComboBoxSetting(comboBoxDirectory, Properties.Settings.Default.DirectoryItems); Properties.Settings.Default.DirectorySubPaths = ApplyComboBoxSetting(comboBoxDirPath, Properties.Settings.Default.DirectorySubPaths); Properties.Settings.Default.FileNames = ApplyComboBoxSetting(comboBoxFileName, Properties.Settings.Default.FileNames); Properties.Settings.Default.Texts = ApplyComboBoxSetting(comboBoxText, Properties.Settings.Default.Texts); ShowHidePreviewPane(); imageLoader = new FileImageLoader(); imageLoader.LoadCompleted += new EventHandler<LoadCompletedEventArgs>(imageLoader_LoadCompleted); }
public MainForm() { InitializeComponent(); // Create an instance of a ListView column sorter and assign it to the ListView control. lvwColumnSorter = new ListViewColumnSorter(); lvwColumnSorter.CompareItems += new EventHandler<ListViewColumnSorterCompareEventArgs>(lvwColumnSorter_CompareItems); this.listViewResults.ListViewItemSorter = lvwColumnSorter; searchEngine = new SearchEngine(); searchEngine.SearchingPath += new EventHandler<SearchEventArgs>(SearchEngineSearchingPath); searchEngine.SearchFound += new EventHandler<SearchFoundEventArgs>(SearchEngineSearchFound); // Apply settings to combo boxes Properties.Settings.Default.DirectoryItems = ApplyComboBoxSetting(comboBoxDirectory, Properties.Settings.Default.DirectoryItems); Properties.Settings.Default.DirectorySubPaths = ApplyComboBoxSetting(comboBoxDirPath, Properties.Settings.Default.DirectorySubPaths); Properties.Settings.Default.FileNames = ApplyComboBoxSetting(comboBoxFileName, Properties.Settings.Default.FileNames); Properties.Settings.Default.Texts = ApplyComboBoxSetting(comboBoxText, Properties.Settings.Default.Texts); ShowHidePreviewPane(); imageLoader = new FileImageLoader(); imageLoader.LoadCompleted += new EventHandler<LoadCompletedEventArgs>(imageLoader_LoadCompleted); }