Beispiel #1
0
 /// <summary>
 /// A file specification.
 /// Folder.EnumerateFiles() generates them from the filesystem.
 /// </summary>
 /// <param name="folder">The folder this file belongs to.</param>
 /// <param name="path">File path in the filesystem.</param>
 public FolderFile(Folder folder, String path)
 {
     this.Folder = folder;
     this.Path = path;
 }
Beispiel #2
0
        /// <summary>
        /// Add the current folder to the list and move on to the next.
        /// </summary>
        private void AddCurrentFolder()
        {
            if (currentFolder != null)
            {
                // check required options:
                if (currentFolder.Name == null)
                {
                    throw ReadError("Folder without name.");
                }

                if (currentFolder.Path == null)
                {
                    throw ReadError("Expected 'path = value' option for folder: " + currentFolder.Name);
                }

                if (currentFolder.Executable == null)
                {
                    throw ReadError("Expected 'executable = value' option for folder: " + currentFolder.Name);
                }

                // create and add the new folder:
                Folder folder = new Folder(
                    currentFolder.Name,
                    currentFolder.Path,
                    currentFolder.Executable,
                    currentFolder.Extensions,
                    currentFolder.Parameters,
                    currentFolder.WorkingDirectory
                );

                folders.Add(folder);
                currentFolder = null;
            }
        }