private void mainView_SelectedIndexChanged(object sender, EventArgs e) { // This will change the web view! if (mainView.FocusedItem == null) { txtInfoTip.Show(); InfoDesc.Hide(); } else { txtInfoTip.Hide(); if (File.Exists(Path.Combine(CurrentDirectory, mainView.FocusedItem.Text))) { // lemon note: no more implementation of windows explorer, because holy hell is it hard and buggy InfoDesc.Show(); FileInfo fi = new FileInfo(Path.Combine(CurrentDirectory, mainView.FocusedItem.Text)); txtInfoDescName.Text = mainView.FocusedItem.Text; txtInfoDescType.Text = GetDescription(ReturnType(fi.Extension)); txtInfoDescModified.Text = fi.CreationTime.ToString(); txtInfoDescSize.Show(); txtInfoDescSize.Text = $"Size: {fi.Length} bytes."; } else if (Directory.Exists(Path.Combine(CurrentDirectory, mainView.FocusedItem.Text))) { txtInfoTip.Hide(); InfoDesc.Show(); DirectoryInfo fi = new DirectoryInfo(Path.Combine(CurrentDirectory, mainView.FocusedItem.Text)); txtInfoDescName.Text = mainView.FocusedItem.Text; txtInfoDescType.Text = "File Folder"; txtInfoDescModified.Text = fi.CreationTime.ToString(); txtInfoDescSize.Hide(); } } }
private void mainView_SelectedIndexChanged(object sender, EventArgs e) { // This will change the web view! if (mainView.FocusedItem == null) { txtInfoTip.Show(); InfoDesc.Hide(); } else { txtInfoTip.Hide(); if (File.Exists(Path.Combine(CurrentDirectory, mainView.FocusedItem.Text))) { // Check if it is a regonized file - if so then in Windows 2000/ME it gives a fancy description bool recognized = false; string description = ""; if (SaveSystem.CurrentSave.CurrentOS == "2000" || SaveSystem.CurrentSave.CurrentOS == "ME") { switch (File.ReadAllText(Path.Combine(CurrentDirectory, mainView.FocusedItem.Text))) { case "explorer": recognized = true; description = "Insert a description here..."; break; } } if (recognized == true) { // TODO: } else { InfoDesc.Show(); FileInfo fi = new FileInfo(Path.Combine(CurrentDirectory, mainView.FocusedItem.Text)); txtInfoDescName.Text = mainView.FocusedItem.Text; txtInfoDescType.Text = ReturnType(fi.Extension).Split('\n')[0]; txtInfoDescModified.Text = fi.CreationTime.ToString(); txtInfoDescSize.Show(); txtInfoDescSize.Text = $"Size: {fi.Length} bytes."; } } else if (Directory.Exists(Path.Combine(CurrentDirectory, mainView.FocusedItem.Text))) { txtInfoTip.Hide(); InfoDesc.Show(); DirectoryInfo fi = new DirectoryInfo(Path.Combine(CurrentDirectory, mainView.FocusedItem.Text)); txtInfoDescName.Text = mainView.FocusedItem.Text; txtInfoDescType.Text = "File Folder"; txtInfoDescModified.Text = fi.CreationTime.ToString(); txtInfoDescSize.Hide(); } } }