示例#1
0
 /// <summary>
 /// Constructs a new blank folder.
 /// </summary>
 protected PFolder(string name, PPackage package, PFolder parentFolder)
 {
     this._attributes = FileAttributes.Normal;
     this._name = name;
     this._files = new List<PFile>();
     this._folders = new List<PFolder>();
     this._package = package;
     this._parentFolder = parentFolder;
     this._lastModified = DateTime.Now;
 }
示例#2
0
        /// <summary>
        /// Loads all items in the given folder.
        /// </summary>
        private static void LoadItems(Protocol protocol, PFolder folderToProcess, CodeReader reader, PPackage package)
        {
            // Declare iteration variable
            int i;
            PFolder subFolder;
            PFile file;

            // Load sub folders
            folderToProcess._folders = new List<PFolder>();
            for (i = 0; i < folderToProcess._folderCount; i++) {
                subFolder = PFolder.Load(protocol, reader, package);
                subFolder.ParentFolder = folderToProcess;
                folderToProcess._folders.Add(subFolder);
            }

            // Load files
            folderToProcess._files = new List<PFile>();
            for (i = 0; i < folderToProcess._fileCount; i++) {
                file = PFile.Load(protocol, reader);
                file.ParentFolder = folderToProcess;
                folderToProcess._files.Add(file);
            }
        }
示例#3
0
 /// <summary>
 /// Saves the folder to disk.
 /// </summary>
 internal abstract void Save(CodeWriter writer, PFolder folder);
示例#4
0
 /// <summary>
 /// Creates a new folder.
 /// </summary>
 internal static PFolder Create(string name, PPackage package, PFolder parentFolder)
 {
     return new PFolderDusseldorf(name, package, parentFolder);
 }
示例#5
0
 /// <summary>
 /// Adds the given folder to this folder.
 /// </summary>
 public void Add(PFolder folder)
 {
     this._folders.Add(folder);
     folder.ParentFolder = this;
 }
示例#6
0
 /// <summary>
 /// Constructs a new blank package.
 /// </summary>
 protected PPackage(bool withRoot)
 {
     if (withRoot)
         this._root = PFolder.Create(@"Root", this, null);
 }
示例#7
0
 /// <summary>
 /// Constructs a new blank file.
 /// </summary>
 internal PFileComet(FileInfo fileInfo, PPackage package, PFolder parentFolder)
     : base(fileInfo, package, parentFolder)
 {
 }