public IndexManager() { InitializeComponent(); //创建一个ListView排序类的对象,并设置listView1的排序器 this.lvwColumnSorter = new ListViewColumnSorter(); this.lvwFIn.ListViewItemSorter = this.lvwColumnSorter; this.lvwFOut.ListViewItemSorter = this.lvwColumnSorter; this.lvwMIn.ListViewItemSorter = this.lvwColumnSorter; this.lvwMOut.ListViewItemSorter = this.lvwColumnSorter; this.lvwColumnSorter.Order = SortOrder.Ascending; this.lvwColumnSorter.SortColumn = 0; this.lvwFIn.Sort(); this.lvwFOut.Sort(); this.lvwMIn.Sort(); this.lvwMOut.Sort(); this.folderBrowserDialog.SelectedPath = ""; //GetSystemIcon getIcon = new GetSystemIcon();//获取图标 //加入文件夹图标 this.imgIcon.Images.Add("folder", GetSystemIcon.GetFolderIcon(false)); this.lblWarning.Text = ""; this.InitData();//初始化索引数据 }
/// <summary> /// 初始化设置 /// </summary> private void InitSettings() { //初始化设置信息 Static.Settings.ReadSettings(); Static.FileIndexPath = Static.Settings.FileIndexPath; Static.MP3IndexPath = Static.Settings.MP3IndexPath; IndexInfoDB indexInfo = new IndexInfoDB(); indexInfo.ReadIndexInfoDB(); Static.MP3Artist = indexInfo.MP3Artist; Static.MP3SongNums = indexInfo.MFileNums; this.停止更新ToolStripMenuItem.Enabled = false; this.保存结果ToolStripMenuItem.Enabled = false; this.tsslLength = this.statusStrip.Width - 120; this.orginalStatusText = "永远别说永远,凡事都有可能。"; this.tsslStatus.Text = Deal.LimitStringLength(this.orginalStatusText, this.tsslLength); this.modeStatus = ModeStatus.FILE; this.magicMirrorStatus = MagicMirrorStatus.Close; this.lvStatus = ListViewStatus.File; this.isSearchWithResult = false; this.indexMode = IndexMode.All; //默认索引模式为所有 this.searchMode = SearchMode.File; //默认搜索模式为文件 //this.index = new Index(this, this.indexMode); this.search = new Search(this, this.searchMode); this.magicMirror = new MagicMirror(); this.magicMirror.SetProperties(MagicMode.None, null); this.pnlMagicMirror.Controls.Add(this.magicMirror); this.magicMirror.Dock = DockStyle.Fill; this.btnNext.Visible = false; this.btnPrevious.Visible = false; this.tsslPages.Visible = false; //加入文件夹图标,未知文件的图标,mp3图标,jpg图标。 this.imgIcon.Images.Add("f", GetSystemIcon.GetFolderIcon(false)); this.imgIcon.Images.Add("u", GetSystemIcon.GetUnknownFileIcon(false)); this.imgIcon.Images.Add(".mp3", GetSystemIcon.GetIconByFileType(".mp3", false)); this.imgIcon.Images.Add(".jpg", GetSystemIcon.GetIconByFileType(".jpg", false)); this.imgIcon.Images.Add(".txt", GetSystemIcon.GetIconByFileType(".txt", false)); this.imgIcon.Images.Add("artist", Properties.Resources.artist); }