Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void SectionViewerActualize() | |
{ | |
FilesViewer.Items.Clear(); | |
SectionViewer.Nodes.Clear(); | |
if (!String.IsNullOrEmpty(actualArea)) | |
SectionViewer.Nodes.AddRange(new SpravaGascripe().CreateNodesArray(actualArea)); | |
} | |
private void CreateSection() | |
{ | |
if (!String.IsNullOrEmpty(actualArea)) | |
{ | |
var cesta = (String.IsNullOrEmpty(actualPath) || SectionViewer.SelectedNode == null || MessageBox.Show("Chceš vytvořit podsekci (ano), či novou hlavní sekci (ne)?", "Ověření", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.No) ? | |
actualArea : actualPath; | |
var doc = Interaction.InputBox("Zadej jméno nové sekce.", "Section Name Dialog", "NewSection"); | |
if (!String.IsNullOrEmpty(doc)) | |
{ | |
new DirectoryInfo(NoExistName(String.IsNullOrEmpty(doc) ? cesta + @"\NewSection" : cesta + @"\" + doc)).Create(); | |
SectionViewerActualize(); | |
} | |
} | |
else | |
MessageBox.Show("Není vybrána žádná oblast!", "Kam s ní?"); | |
} | |
private void EditSectionName() | |
{ | |
if (SectionViewer.SelectedNode != null) | |
{ | |
var doc = Interaction.InputBox("Zadej nové jméno sekce.", "Change Name Dialog", Path.GetFileName(actualPath)); | |
var di = new DirectoryInfo(actualPath); | |
if (!String.IsNullOrEmpty(doc)) | |
{ | |
var act = di.Parent.FullName + @"\" + doc; | |
if (act != actualPath + @"\" + doc) | |
di.MoveTo(NoExistName(act)); | |
} | |
SectionViewerActualize(); | |
} | |
} | |
private void RemoveSection() | |
{ | |
if (SectionViewer.SelectedNode != null) | |
{ | |
if (MessageBox.Show("Opravdu chceš sekci '" + Path.GetFileName(actualPath) + "' smazat?", "Potvrzení smazání", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes) | |
new DirectoryInfo(actualPath).Delete(true); | |
actualPath = null; | |
FilesViewer.Items.Clear(); | |
SectionViewerActualize(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment