示例#1
0
        /// <summary>
        /// Add a sub directory with the specified name.
        /// </summary>
        /// <param name="name">The name of the sub directory to add.</param>
        /// <returns>The <see cref="OutputDirectoryInfo"/> object added.</returns>
        public OutputDirectoryInfo AddSubDirectory(string name)
        {
            int sepIndex = name.IndexOf(System.IO.Path.PathSeparator);

            if (sepIndex > 0)
            {
                string firstName = name.Substring(0, sepIndex);

                var subdir = this.GetDirectory(firstName);
                if (subdir == null)
                {
                    subdir = new OutputDirectoryInfo(firstName, this);

                    subdir.AddSubDirectory(name.Substring(sepIndex + 1));

                    this.SubDirectories.Add(subdir);
                }

                return(subdir);
            }
            else
            {
                var subdir = this.GetDirectory(name);

                if (subdir == null)
                {
                    subdir = new OutputDirectoryInfo(name, this);

                    this.SubDirectories.Add(subdir);
                }

                return(subdir);
            }
        }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OutputDirectoryInfo"/> class.
 /// </summary>
 /// <param name="name">The name of the directory.</param>
 /// <param name="directory">The parent directory.</param>
 public OutputDirectoryInfo(string name, OutputDirectoryInfo directory)
     : base(name, directory)
 {
     this.Shortcuts      = new List <OutputShortcutInfo>();
     this.Files          = new List <OutputFileInfo>();
     this.SubDirectories = new List <OutputDirectoryInfo>();
 }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OutputDirectoryInfo"/> class.
 /// </summary>
 /// <param name="name">The name of the directory.</param>
 /// <param name="directory">The parent directory.</param>
 public OutputDirectoryInfo(string name, OutputDirectoryInfo directory)
     : base(name, directory)
 {
     this.Shortcuts = new List<OutputShortcutInfo>();
     this.Files = new List<OutputFileInfo>();
     this.SubDirectories = new List<OutputDirectoryInfo>();
 }
示例#4
0
        /// <summary>
        /// Add a directory to a information file, using the specified build profile.
        /// </summary>
        /// <param name="inf">The information file to add the directory to.</param>
        /// <param name="profile">The build profile used.</param>
        /// <param name="directoryInfo">The directory to add.</param>
        /// <remarks>
        ///     <para>
        ///         See <see cref="AddToCabwiz(Cabwiz.InformationFile inf, BuildProfile profile, FileInfo file)"/>
        ///             for information about what files are excluded.
        ///     </para>
        /// </remarks>
        private void AddToCabwiz(Cabwiz.InformationFile inf, BuildProfile profile, OutputDirectoryInfo directoryInfo)
        {
            foreach (var subDirectory in directoryInfo.SubDirectories)
            {
                this.AddToCabwiz(inf, profile, subDirectory);
            }

            foreach (var file in directoryInfo.Files)
            {
                this.AddToCabwiz(inf, profile, file);
            }
        }
示例#5
0
 /// <summary>
 /// Initializes a new instance of the OutputShortcutInfo class with the specified target, filename and parent directory.
 /// </summary>
 /// <param name="target">The target which this shortcut points at.</param>
 /// <param name="name">The name of the shortcut file.</param>
 /// <param name="directory">The directory in which the shortcut will be created.</param>
 public OutputShortcutInfo(OutputFileSystemInfo target, string name, OutputDirectoryInfo directory)
     : base(name, directory)
 {
     this.Target = target;
 }
示例#6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OutputFileSystemInfo"/> class, to located within the specified directory.
 /// </summary>
 /// <param name="name">The name for the file system item.</param>
 /// <param name="directory">The parent directory for this filesystem item. This parameter can be null.</param>
 /// <exception cref="ArgumentNullException"><paramref name="name"/> is null or empty.</exception>
 protected OutputFileSystemInfo(string name, OutputDirectoryInfo directory)
     : this(name)
 {
     this.Directory = directory;
 }
示例#7
0
 /// <summary>
 /// Initializes a new instance of the OutputShortcutInfo class with the specified target, filename and parent directory.
 /// </summary>
 /// <param name="target">The target which this shortcut points at.</param>
 /// <param name="name">The name of the shortcut file.</param>
 /// <param name="directory">The directory in which the shortcut will be created.</param>
 public OutputShortcutInfo(OutputFileSystemInfo target, string name, OutputDirectoryInfo directory)
     : base(name, directory)
 {
     this.Target = target;
 }
示例#8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OutputFileInfo"/> class.
 /// </summary>
 /// <param name="fileName">The filename of the file, as it will be on the target machine's file system.</param>
 /// <param name="sourceFile">The full path and filename of the file that will be included in a build.</param>
 /// <param name="parentDirectory">The parent directory for this file.</param>
 public OutputFileInfo(string fileName, string sourceFile, OutputDirectoryInfo parentDirectory, IncludeRule rule)
     : this(fileName, parentDirectory)
 {
     this.SourceFile  = sourceFile;
     this.IncludeRule = rule;
 }
示例#9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OutputFileInfo"/> class.
 /// </summary>
 /// <param name="fileName">The filename of the file, as it will be on the target machine's file system.</param>
 /// <param name="parentDirectory">The parent directory for this file.</param>
 public OutputFileInfo(string fileName, OutputDirectoryInfo parentDirectory)
     : base(fileName, parentDirectory)
 {
     // nothing
 }
示例#10
0
        /// <summary>
        /// Add a sub directory with the specified name.
        /// </summary>
        /// <param name="name">The name of the sub directory to add.</param>
        /// <returns>The <see cref="OutputDirectoryInfo"/> object added.</returns>
        public OutputDirectoryInfo AddSubDirectory(string name)
        {
            int sepIndex = name.IndexOf(System.IO.Path.PathSeparator);

            if (sepIndex > 0)
            {
                string firstName = name.Substring(0, sepIndex);

                var subdir = this.GetDirectory(firstName);
                if (subdir == null)
                {
                    subdir = new OutputDirectoryInfo(firstName, this);

                    subdir.AddSubDirectory(name.Substring(sepIndex + 1));

                    this.SubDirectories.Add(subdir);
                }

                return subdir;
            }
            else
            {
                var subdir = this.GetDirectory(name);

                if (subdir == null)
                {
                    subdir = new OutputDirectoryInfo(name, this);

                    this.SubDirectories.Add(subdir);
                }

                return subdir;
            }
        }
示例#11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OutputFileSystemInfo"/> class, to located within the specified directory.
 /// </summary>
 /// <param name="name">The name for the file system item.</param>
 /// <param name="directory">The parent directory for this filesystem item. This parameter can be null.</param>
 /// <exception cref="ArgumentNullException"><paramref name="name"/> is null or empty.</exception>
 protected OutputFileSystemInfo(string name, OutputDirectoryInfo directory)
     : this(name)
 {
     this.Directory = directory;
 }
示例#12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OutputFileInfo"/> class.
 /// </summary>
 /// <param name="fileName">The filename of the file, as it will be on the target machine's file system.</param>
 /// <param name="sourceFile">The full path and filename of the file that will be included in a build.</param>
 /// <param name="parentDirectory">The parent directory for this file.</param>
 public OutputFileInfo(string fileName, string sourceFile, OutputDirectoryInfo parentDirectory, IncludeRule rule)
     : this(fileName, parentDirectory)
 {
     this.SourceFile = sourceFile;
     this.IncludeRule = rule;
 }
示例#13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OutputFileInfo"/> class.
 /// </summary>
 /// <param name="fileName">The filename of the file, as it will be on the target machine's file system.</param>
 /// <param name="parentDirectory">The parent directory for this file.</param>
 public OutputFileInfo(string fileName, OutputDirectoryInfo parentDirectory)
     : base(fileName, parentDirectory)
 {
     // nothing
 }
示例#14
0
        /// <summary>
        /// Add a directory to a information file, using the specified build profile.
        /// </summary>
        /// <param name="inf">The information file to add the directory to.</param>
        /// <param name="profile">The build profile used.</param>
        /// <param name="directoryInfo">The directory to add.</param>
        /// <remarks>
        ///     <para>
        ///         See <see cref="AddToCabwiz(Cabwiz.InformationFile inf, BuildProfile profile, FileInfo file)"/>
        ///             for information about what files are excluded.
        ///     </para>
        /// </remarks>
        private void AddToCabwiz(Cabwiz.InformationFile inf, BuildProfile profile, OutputDirectoryInfo directoryInfo)
        {
            foreach (var subDirectory in directoryInfo.SubDirectories)
            {
                this.AddToCabwiz(inf, profile, subDirectory);
            }

            foreach (var file in directoryInfo.Files)
            {
                this.AddToCabwiz(inf, profile, file);
            }
        }