private void ProjectListView_ItemActivate(object sender, System.EventArgs e){//ItemInfo when Selecting a ListView ItemDirectoryInfo ItemInfo = new DirectoryInfo(sProjectsPath + "\\" + ProjectTreeView.SelectedNode.FullPath + "\\" + ProjectListView.SelectedItems[0].Text);// Show Directory Path of ItemInfo in StatusBarStatusLabel1.Text = (ItemInfo.ToString());//If the ItemInfo is a file then run the fileif (ItemInfo.Exists != true){try{Process.Start(ItemInfo.ToString());}catch (Exception Exc) { MessageBox.Show(Exc.ToString()); }}//If the ItemInfo is a folder then open the folder in ListViewelse{try{ProjectListView.BeginUpdate();ProjectListView.Items.Clear();ListViewItem.ListViewSubItem[] subItems;ListViewItem item = null;//ListView items are foldersforeach (DirectoryInfo dir in ItemInfo.GetDirectories()){item = new ListViewItem(dir.Name, 1);subItems = new ListViewItem.ListViewSubItem[]{ new ListViewItem.ListViewSubItem(item, ""),new ListViewItem.ListViewSubItem(item, "File Folder"),new ListViewItem.ListViewSubItem(item, dir.LastAccessTime.ToShortDateString()) };item.SubItems.AddRange(subItems);ProjectListView.Items.Add(item);}//ListView items are filesforeach (FileInfo file in ItemInfo.GetFiles()){item = new ListViewItem(file.Name, 2);subItems = new ListViewItem.ListViewSubItem[]{new ListViewItem.ListViewSubItem(item, Convert.ToString(file.Length / 1024) + " kB"),new ListViewItem.ListViewSubItem(item, "File"),new ListViewItem.ListViewSubItem(item, file.LastAccessTime.ToShortDateString())};item.SubItems.AddRange(subItems);ProjectListView.Items.Add(item);}ProjectListView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);ProjectListView.EndUpdate();}catch (Exception Exc) { MessageBox.Show(Exc.ToString()); }}}