Beispiel #1
0
        public static FSItem inDirectory(MDirectory parent, string path)
        {
            MDirectory rootFolder = new MDirectory(new DirectoryInfo(path).Name, parent);

            DirectoryInfo dir = new DirectoryInfo(path);
            //============Список каталогов=============
            foreach (var item in dir.GetDirectories())
                rootFolder.addItem(new MDirectory(item.Name, rootFolder));
            //==============Список файлов==============
            foreach (var item in dir.GetFiles())
                rootFolder.addItem(new MFile(item.Name, rootFolder));

            return rootFolder;
        }
Beispiel #2
0
        public static FSItem inDirectory(MDirectory parent, string path)
        {
            MDirectory rootFolder = new MDirectory(new DirectoryInfo(path).Name, parent);

            DirectoryInfo dir = new DirectoryInfo(path);

            //============Список каталогов=============
            foreach (var item in dir.GetDirectories())
            {
                rootFolder.addItem(new MDirectory(item.Name, rootFolder));
            }
            //==============Список файлов==============
            foreach (var item in dir.GetFiles())
            {
                rootFolder.addItem(new MFile(item.Name, rootFolder));
            }

            return(rootFolder);
        }
Beispiel #3
0
 public MDirectory(string name, MDirectory parent)
 {
     this.name   = name;
     this.parent = parent;
     items       = new List <FSItem>();
 }
 public MDirectoryAdapter(MDirectory adaptee)
 {
     this.adaptee = adaptee;
 }
Beispiel #5
0
 public MDirectory(string name, MDirectory parent)
 {
     this.name = name;
     this.parent = parent;
     items = new List<FSItem>();
 }
Beispiel #6
0
 public MDirectoryAdapter(MDirectory adaptee)
 {
     this.adaptee = adaptee;
 }
Beispiel #7
0
 public MFile(string name, MDirectory parent)
 {
     this.name = name;
     this.parent = parent;
 }
Beispiel #8
0
 public MFile(string name, MDirectory parent)
 {
     this.name   = name;
     this.parent = parent;
 }