コード例 #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();
     }
 }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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();
     }
 }
コード例 #5
0
ファイル: History.cs プロジェクト: LakmoES/IPO_FileManager
 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;
 }
コード例 #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);
            }
        }
コード例 #7
0
ファイル: History.cs プロジェクト: LakmoES/IPO_FileManager
        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;
            }
        }
コード例 #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);
        }
コード例 #9
0
ファイル: History.cs プロジェクト: LakmoES/IPO_FileManager
        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;
        }
コード例 #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;
 }
コード例 #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();
     }
 }