Beispiel #1
0
 private void button2_Click(object sender, EventArgs e)
 {
     Infobox.PromptText("Create filesystem", "Please name your file system.", (result) =>
     {
         if (string.IsNullOrWhiteSpace(result))
         {
             MessageBox.Show(text: "ShiftFS does not allow blank volume names.", caption: "Volume name can't be blank", icon: MessageBoxIcon.Error, buttons: MessageBoxButtons.OK);
         }
         else
         {
             var dir         = new Directory();
             dir.Name        = result;
             dir.permissions = Objects.UserPermissions.Guest;
             Mounts.Add(dir);
             SetupTree();
         }
     });
 }
Beispiel #2
0
 private void newDirectoryToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (DirectoryExists(tvfiles.SelectedNode.Tag.ToString()))
     {
         Infobox.PromptText("New directory", "Please name your directory.", (result) =>
         {
             if (string.IsNullOrWhiteSpace(result))
             {
                 MessageBox.Show(text: "ShiftFS does not allow blank directory names.", caption: "Directory name can't be blank", icon: MessageBoxIcon.Error, buttons: MessageBoxButtons.OK);
             }
             else
             {
                 var dinf = GetDirectoryInfo(tvfiles.SelectedNode.Tag.ToString());
                 dinf.AddDirectory(new Directory
                 {
                     Name        = result,
                     permissions = Objects.UserPermissions.Guest
                 });
                 SetupTree();
             }
         });
     }
 }