Esempio n. 1
0
 public Directory(string name, Drive drive, Directory directory)
 {
     _name =             name;
     _parentDrive =      drive;
     _parentDirectory =  directory;
     _directories =      new List<Directory>();
     _files =            new List<File>();
 }
Esempio n. 2
0
 public File(string name, string content, Directory parentDirectory)
 {
     _name =             name;
     _content =          content;
     _parentDirectory =  parentDirectory;
 }
Esempio n. 3
0
 /// <summary>
 /// Set the parent Directory of the File
 /// </summary>
 /// <param name="directory"></param>
 /// <returns></returns>
 public Directory SetParentDirectory(Directory directory)
 {
     _parentDirectory = directory;
     return _parentDirectory;
 }
Esempio n. 4
0
 /// <summary>
 /// Add a Directory as Sub-Directory
 /// </summary>
 /// <param name="dir"></param>
 /// <returns></returns>
 public int AddDirectory(Directory dir)
 {
     if (_directories.Any(x => x == dir)) return 1;
     _directories.Add(dir);
     return 0;
 }
Esempio n. 5
0
 /// <summary>
 /// Remove a Directory as Sub-Directory
 /// </summary>
 /// <param name="dir"></param>
 /// <returns></returns>
 public int RemoveDirectory(Directory dir)
 {
     if (_directories.Any(x => x != dir)) return 1;
     _directories.Remove(dir);
     return 0;
 }