예제 #1
0
 public FileManager(string path, LoadOption loadOption)
 {
     this.path       = path;
     this.loadOption = loadOption;
     list            = new VirtualFileList(loadOption);
     imagePath       = list.GetImagePath(path);
 }
예제 #2
0
        //親ディレクトリを取得 =0 current -1 previous +1 next
        public string GetParent(string path, int step)
        {
            String dir = path;

            if (Parent != null)
            {
                Parent.dirPos += step;
                if (Parent.dirPos < 0)
                {
                    Parent.dirPos = Parent.dirInfos.Length - 1;
                }

                if (Parent.dirPos > Parent.dirInfos.Length - 1)
                {
                    Parent.dirPos = 0;
                }
            }
            else
            {
                Parent = new VirtualFileList(loadOption);
                Parent.SearchDirectry(infos[currentPos].Parent);

                Parent.SearchCurrentDirectryPos(infos[currentPos].DirectoryFullName);

                DirectoryInfo directoryInfo = new DirectoryInfo(dir);
                if (directoryInfo.FullName == null)
                {
                    return(null);
                }
                Parent.dirPos += step;
                if (Parent.dirPos < 0)
                {
                    Parent.dirPos = Parent.dirInfos.Length - 1;
                }

                if (Parent.dirPos > Parent.dirInfos.Length - 1)
                {
                    Parent.dirPos = 0;
                }
            }
            return(Parent.GetDirectory());
        }