Exemple #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;
 }
Exemple #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);
            }
        }
Exemple #3
0
        /// <summary>
        /// Returns a new folder, using the provided protocol and reader.
        /// </summary>
        internal static PFolder Load(Protocol protocol, CodeReader reader, PPackage package)
        {
            // Create new folder using the provided protocol
            PFolder result = protocol.FolderProtocol.Load(reader);
            result._package = package;

            // Load all items in the folder
            LoadItems(protocol, result, reader, package);

            // Return the folder
            return result;
        }
Exemple #4
0
 /// <summary>
 /// Creates a new folder.
 /// </summary>
 internal static PFolder Create(string name, PPackage package, PFolder parentFolder)
 {
     return new PFolderDusseldorf(name, package, parentFolder);
 }
Exemple #5
0
 /// <summary>
 /// Saves the package to disk.
 /// </summary>
 internal abstract void Save(CodeWriter writer, PPackage package);
Exemple #6
0
 /// <summary>
 /// Constructs a new blank file.
 /// </summary>
 internal PFileComet(FileInfo fileInfo, PPackage package, PFolder parentFolder)
     : base(fileInfo, package, parentFolder)
 {
 }