Exemplo n.º 1
0
        private void MENU1(object sender, EventArgs e)
        {
            Form3 f = new Form3(FileMethods.Combine(view.getsetFi, view.getsetListView.SelectedItems[0].Text), view.getsetListView.SelectedItems[0].Tag.ToString(), "copy");

            f.ThrowEvent += (senderio, args, st, delo) => { OnkoZakrito(st, delo); };
            f.ShowDialog();
        }
Exemplo n.º 2
0
 public void addLevel(string name)
 {
     if (myPath.Length == 0)
     {
         myPath += name;
         return;
     }
     //myPath += @"\" + name;
     myPath = FileMethods.Combine(myPath, name);
 }
Exemplo n.º 3
0
 private void MENU10(object sender, EventArgs e)
 {
     if (view.getsetListView.SelectedItems[0].Tag.ToString() == "file")
     {
         FileMethods m = new FileMethods(FileMethods.Combine(view.getsetFi, view.getsetListView.SelectedItems[0].Text));
         m.Accept(visitor);
     }
     else
     {
         FolderMethods m = new FolderMethods(FolderMethods.Combine(view.getsetFi, view.getsetListView.SelectedItems[0].Text));
         m.Accept(visitor);
     }
 }
Exemplo n.º 4
0
        protected void OnkoZakrito(string s, string dela)
        {
            if (dela == "copy")
            {
                try
                {
                    if (view.getsetListView.SelectedItems[0].Tag.ToString() == "file")
                    {
                        FileMethods.copy(FileMethods.Combine(view.getsetFi, view.getsetListView.SelectedItems[0].Text), FileMethods.Combine(s, view.getsetListView.SelectedItems[0].Text), true);
                    }
                    else
                    {
                        // directory
                    }
                }
                catch (Exception e)
                {
                }
                return;
            }
            if (dela == "replace")
            {
                if (view.getsetListView.SelectedItems[0].Tag.ToString() == "file")
                {
                    FileMethods.move(FileMethods.Combine(view.getsetFi, view.getsetListView.SelectedItems[0].Text), FileMethods.Combine(s, view.getsetListView.SelectedItems[0].Text));
                }
                else
                {
                    FolderMethods.move(FileMethods.Combine(view.getsetFi, view.getsetListView.SelectedItems[0].Text), s);
                }
                return;
            }

            if (dela == "rename")
            {
                if (view.getsetListView.SelectedItems[0].Tag.ToString() == "directory")
                {
                    FolderMethods.move(FileMethods.Combine(view.getsetFi, view.getsetListView.SelectedItems[0].Text),
                                       FileMethods.Combine(view.getsetFi, s));
                    view.renewList();
                    return;
                }
                FileMethods.delete(FileMethods.Combine(view.getsetFi, s));
                string h   = view.getsetListView.SelectedItems[0].Text;
                int    ind = h.IndexOf('.');
                h = h.Substring(ind);
                FileMethods.move(FileMethods.Combine(view.getsetFi, view.getsetListView.SelectedItems[0].Text), FileMethods.Combine(view.getsetFi, s + h));
                view.renewList();
            }
        }
Exemplo n.º 5
0
 private void decryptClickedRealize(object sender, EventArgs e)
 {
     if (view.getsetListView.SelectedItems.Count > 0)
     {
         if (view.getsetListView.SelectedItems[0].Tag.ToString() == "file")
         {
             FileMethods m = new FileMethods(FileMethods.Combine(view.getsetFi, view.getsetListView.SelectedItems[0].Text));
             CesarEncrypt.setKey(int.Parse(view.getsetEncryptTExtBox));
             m.Accept(CesarEncrypt);
         }
         else
         {
             FolderMethods m = new FolderMethods(FolderMethods.Combine(view.getsetFi, view.getsetListView.SelectedItems[0].Text));
             CesarEncrypt.setKey(int.Parse(view.getsetEncryptTExtBox));
             m.Accept(CesarEncrypt);
         }
     }
 }
Exemplo n.º 6
0
 private void MENU2(object sender, EventArgs e)
 {
     if (view.getsetFi.Contains(".zip"))
     {
         new ZippedFile(view.getsetFi).Delete(view.getsetListView.SelectedItems[0].Text);
     }
     else
     {
         if (view.getsetListView.SelectedItems[0].Tag.ToString() == "file")
         {
             FileMethods.delete(FileMethods.Combine(view.getsetFi, view.getsetListView.SelectedItems[0].Text));
         }
         else
         {
             FolderMethods.DeleteDirectory(FileMethods.Combine(view.getsetFi, view.getsetListView.SelectedItems[0].Text));
         }
     }
     view.renewList();
 }
Exemplo n.º 7
0
        private void MENU9(object sender, EventArgs e)
        {
            Form8 form = new Form8(FileMethods.Combine(view.getsetFi, view.getsetListView.SelectedItems[0].Text));

            form.ShowDialog();
        }