private void toolStripMenuItem4_Click_1(object sender, EventArgs e) { DialogBox CreateFile = new DialogBox(); DialogBox.way = LeftPath; createThing = 4; CreateFile.Show(); }
private void sdToolStripMenuItem_Click(object sender, EventArgs e)//Button "Create text file .txt" { DialogBox CreateFile = new DialogBox(); DialogBox.way = LeftPath; createThing = 5; CreateFile.Show(); }
private void toolStripMenuItem1_Click(object sender, EventArgs e)//Button "Create directory" { DialogBox CreateFile = new DialogBox(); DialogBox.way = LeftPath; createThing = 1; CreateFile.Show(); }
/// Button "Rename" private void toolStripButton4_Click(object sender, EventArgs e) { ListViewItem item; if ((LeftList.SelectedItems.Count != 0)) { item = LeftList.SelectedItems[0]; DialogBox.format = Navigator.ReturnFormat(item.Text); DialogBox.way=LeftPath; DialogBox CreateFile = new DialogBox(); lastname = item.Text; createThing = 6; CreateFile.Show(); if (DialogBox.done == true) { try { Navigator.GetFiles(ref LeftPath, LeftList); Navigator.GetFiles(ref RightPath, RightList); } catch (DirectoryNotFoundException) { string path = "C:\\"; Navigator.GetFiles(ref path, LeftList); Navigator.GetFiles(ref path, RightList); } DialogBox.done = false; } } else if (RightList.SelectedItems.Count != 0) { item = RightList.SelectedItems[0]; DialogBox.format = Navigator.ReturnFormat(item.Text); DialogBox.way = RightPath; DialogBox CreateFile = new DialogBox(); lastname = item.Text; createThing = 6; CreateFile.Show(); if (DialogBox.done == true) { try { Navigator.GetFiles(ref LeftPath, LeftList); Navigator.GetFiles(ref RightPath, RightList); } catch (DirectoryNotFoundException) { string path = "C:\\"; Navigator.GetFiles(ref path, LeftList); Navigator.GetFiles(ref path, RightList); } DialogBox.done = false; } } else { MessageBox.Show("You haven't choosen a file", "Error", MessageBoxButtons.OKCancel, MessageBoxIcon.Error); } }
/// Button "Rename" private void toolStripButton4_Click(object sender, EventArgs e) { ListViewItem item; if ((LeftList.SelectedItems.Count != 0)) { item = LeftList.SelectedItems[0]; DialogBox.format = Navigator.ReturnFormat(item.Text); DialogBox.way = LeftPath; DialogBox CreateFile = new DialogBox(); lastname = item.Text; createThing = 6; CreateFile.Show(); if (DialogBox.done == true) { try { Navigator.GetFiles(ref LeftPath, LeftList); Navigator.GetFiles(ref RightPath, RightList); } catch (DirectoryNotFoundException) { string path = "C:\\"; Navigator.GetFiles(ref path, LeftList); Navigator.GetFiles(ref path, RightList); } DialogBox.done = false; } } else if (RightList.SelectedItems.Count != 0) { item = RightList.SelectedItems[0]; DialogBox.format = Navigator.ReturnFormat(item.Text); DialogBox.way = RightPath; DialogBox CreateFile = new DialogBox(); lastname = item.Text; createThing = 6; CreateFile.Show(); if (DialogBox.done == true) { try { Navigator.GetFiles(ref LeftPath, LeftList); Navigator.GetFiles(ref RightPath, RightList); } catch (DirectoryNotFoundException) { string path = "C:\\"; Navigator.GetFiles(ref path, LeftList); Navigator.GetFiles(ref path, RightList); } DialogBox.done = false; } } else { MessageBox.Show("You haven't choosen a file", "Error", MessageBoxButtons.OKCancel, MessageBoxIcon.Error); } }