Ejemplo n.º 1
0
 public void enter(FSItem item)
 {
     if (browserControll.execute(enterID, item))
     {
         FSItem newItem = FSScan.inDirectory(item.getParent, address + "\\" + item.getName);
         item.getFolder().clearChildren();
         foreach (FSItem it in newItem.getFolder().getChildren)
         {
             item.getFolder().addItem(it);
         }
         drawInView();
     }
 }
Ejemplo n.º 2
0
        public bool paste(FSItem item)
        {
            string destinationPath = getFullPath(rootItem) + "\\" + item.getName;
            string sourcePath      = getFullPath(item);

            if (item.getFolder() == null)
            {
                File.Copy(sourcePath, destinationPath);
            }
            else
            {
                Directory.CreateDirectory(destinationPath);
                //Now Create all of the directories
                foreach (string dirPath in Directory.GetDirectories(sourcePath, "*",
                                                                    SearchOption.AllDirectories))
                {
                    Directory.CreateDirectory(dirPath.Replace(sourcePath, destinationPath));
                }

                //Copy all the files & Replaces any files with the same name
                foreach (string newPath in Directory.GetFiles(sourcePath, "*.*",
                                                              SearchOption.AllDirectories))
                {
                    File.Copy(newPath, newPath.Replace(sourcePath, destinationPath), true);
                }
            }
            return(true);
        }
Ejemplo n.º 3
0
        public long size(FSItem item)
        {
            Measured measured;

            if (item.getFolder() == null)
            {
                measured = item as Measured;
            }
            else
            {
                measured = new MDirectoryAdapter(item as MDirectory);
            }
            return(measured.getSize);
        }
Ejemplo n.º 4
0
 public void delete(FSItem item)
 {
     if (browserControll.execute(deleteID, item, true))
     {
         FSItem   rootItem = FSScan.inDirectory(history.getRootItem.getParent, address);
         FSItem[] children = rootItem.getFolder().getChildren;
         history.getRootItem.getFolder().clearChildren();
         foreach (FSItem it in children)
         {
             history.getRootItem.getFolder().addItem(it);
         }
         drawInView();
     }
 }
Ejemplo n.º 5
0
 public bool delete(FSItem item)
 {
     string fullPath = getFullPath(item);
     if (item.getFolder() != null)
     {
         if (!Directory.Exists(fullPath))
             throw new DirectoryNotFoundException("Указанная папка не существует: " + item.getName);
         Directory.Delete(fullPath, true);
     }
     else
     {
         if (!File.Exists(fullPath))
             throw new FileNotFoundException("Указанный файл не существует: " + item.getName , item.getName);
         File.Delete(fullPath);
     }
     return true;
 }
Ejemplo n.º 6
0
        public bool enter(FSItem item)
        {
            if (item.getFolder() != null)
            {
                rootItem = item;
                return(true);
            }
            else
            {
                FSItem tmp  = item;
                string path = tmp.getName;
                while (tmp.getParent != null)
                {
                    path = tmp.getParent.getName.Trim('\\') + "\\" + path;
                    tmp  = tmp.getParent;
                }
                Process.Start(path);

                return(false);
            }
        }
Ejemplo n.º 7
0
        public bool enter(FSItem item)
        {
            if (item.getFolder() != null)
            {
                rootItem = item;
                return true;
            }
            else
            {
                FSItem tmp = item;
                string path = tmp.getName;
                while (tmp.getParent != null)
                {
                    path = tmp.getParent.getName.Trim('\\') + "\\" + path;
                    tmp = tmp.getParent;
                }
                Process.Start(path);

                return false;
            }
        }
Ejemplo n.º 8
0
        public bool delete(FSItem item)
        {
            string fullPath = getFullPath(item);

            if (item.getFolder() != null)
            {
                if (!Directory.Exists(fullPath))
                {
                    throw new DirectoryNotFoundException("Указанная папка не существует: " + item.getName);
                }
                Directory.Delete(fullPath, true);
            }
            else
            {
                if (!File.Exists(fullPath))
                {
                    throw new FileNotFoundException("Указанный файл не существует: " + item.getName, item.getName);
                }
                File.Delete(fullPath);
            }
            return(true);
        }
Ejemplo n.º 9
0
        public bool paste(FSItem item)
        {
            string destinationPath = getFullPath(rootItem) + "\\" + item.getName;
            string sourcePath = getFullPath(item);
            if(item.getFolder() == null)
                File.Copy(sourcePath, destinationPath);
            else
            {

                Directory.CreateDirectory(destinationPath);
                //Now Create all of the directories
                foreach (string dirPath in Directory.GetDirectories(sourcePath, "*",
                    SearchOption.AllDirectories))
                    Directory.CreateDirectory(dirPath.Replace(sourcePath, destinationPath));

                //Copy all the files & Replaces any files with the same name
                foreach (string newPath in Directory.GetFiles(sourcePath, "*.*",
                    SearchOption.AllDirectories))
                    File.Copy(newPath, newPath.Replace(sourcePath, destinationPath), true);
            }
            return true;
        }
Ejemplo n.º 10
0
 public long size(FSItem item)
 {
     Measured measured;
     if (item.getFolder() == null)
         measured = item as Measured;
     else
         measured = new MDirectoryAdapter(item as MDirectory);
     return measured.getSize;
 }
Ejemplo n.º 11
0
 public void enter(FSItem item)
 {
     if (browserControll.execute(enterID, item))
     {
         FSItem newItem = FSScan.inDirectory(item.getParent, address + "\\" + item.getName);
         item.getFolder().clearChildren();
         foreach (FSItem it in newItem.getFolder().getChildren)
             item.getFolder().addItem(it);
         drawInView();
     }
 }