Exemplo n.º 1
0
        /// <summary>
        /// Add a file to this directory.
        /// </summary>
        /// <param name="fileName">The name of the file as it will be on the target file system.</param>
        /// <param name="sourceFileName">The source file.</param>
        /// <returns>The <see cref="OutputFileInfo"/> object added.</returns>
        public OutputFileInfo AddFile(string fileName, string sourceFileName, IncludeRule rule)
        {
            var fileInfo = new OutputFileInfo(fileName, sourceFileName, this, rule);

            this.Files.Add(fileInfo);

            return(fileInfo);
        }
Exemplo n.º 2
0
        private void AddShortcut(string shortcutFileName, OutputFileInfo outputFile, IncludeRule rule)
        {
            var path     = System.IO.Path.GetDirectoryName(shortcutFileName);
            var fileName = System.IO.Path.GetFileName(shortcutFileName);

            var dir = this.StartMenu;

            if (!string.IsNullOrEmpty(path))
            {
                dir = dir.AddSubDirectory(path);
            }

            dir.AddShortcut(fileName, outputFile, rule);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Add a file to the project output, with the specified filename.
        /// </summary>
        /// <param name="rule">The rule which included the file.</param>
        /// <param name="fileInfo">The file on the harddrive which contents to include.</param>
        /// <param name="fileName">The name to use on the target machine.</param>
        private void AddFile(IncludeRule rule, System.IO.FileInfo fileInfo, string fileName)
        {
            var dir = this.InstallationDirectory;

            if (!string.IsNullOrEmpty(rule.Folder))
            {
                dir = dir.AddSubDirectory(rule.Folder);
            }

            if (string.IsNullOrEmpty(fileName))
            {
                fileName = fileInfo.Name;
            }

            var outputFile = dir.AddFile(fileName, fileInfo.FullName, rule);

            if (!string.IsNullOrEmpty(rule.StartMenuShortcut))
            {
                this.AddShortcut(rule.StartMenuShortcut, outputFile, rule);
            }
        }
Exemplo n.º 4
0
        public OutputShortcutInfo AddShortcut(string shortcutFileName, OutputFileInfo target, IncludeRule rule)
        {
            var shortcutInfo = new OutputShortcutInfo(target, shortcutFileName, this);

            this.Shortcuts.Add(shortcutInfo);

            return(shortcutInfo);
        }
Exemplo n.º 5
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;
 }
Exemplo n.º 6
0
        public OutputShortcutInfo AddShortcut(string shortcutFileName, OutputFileInfo target, IncludeRule rule)
        {
            var shortcutInfo = new OutputShortcutInfo(target, shortcutFileName, this);

            this.Shortcuts.Add(shortcutInfo);

            return shortcutInfo;
        }
Exemplo n.º 7
0
 /// <summary>
 /// Add a file to the project output, preserving the filename.
 /// </summary>
 /// <param name="rule">The rule which included the file.</param>
 /// <param name="fileInfo">The file on the harddrive to include.</param>
 private void AddFile(IncludeRule rule, System.IO.FileInfo fileInfo)
 {
     this.AddFile(rule, fileInfo, fileInfo.Name);
 }
Exemplo n.º 8
0
        /// <summary>
        /// Add a file to this directory.
        /// </summary>
        /// <param name="fileName">The name of the file as it will be on the target file system.</param>
        /// <param name="sourceFileName">The source file.</param>
        /// <returns>The <see cref="OutputFileInfo"/> object added.</returns>
        public OutputFileInfo AddFile(string fileName, string sourceFileName, IncludeRule rule)
        {
            var fileInfo = new OutputFileInfo(fileName, sourceFileName, this, rule);

            this.Files.Add(fileInfo);

            return fileInfo;
        }
Exemplo n.º 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="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;
 }
Exemplo n.º 10
0
        private void AddShortcut(string shortcutFileName, OutputFileInfo outputFile, IncludeRule rule)
        {
            var path = System.IO.Path.GetDirectoryName(shortcutFileName);
            var fileName = System.IO.Path.GetFileName(shortcutFileName);

            var dir = this.StartMenu;

            if (!string.IsNullOrEmpty(path))
            {
                dir = dir.AddSubDirectory(path);
            }

            dir.AddShortcut(fileName, outputFile, rule);
        }
Exemplo n.º 11
0
        /// <summary>
        /// Add a file to the project output, with the specified filename.
        /// </summary>
        /// <param name="rule">The rule which included the file.</param>
        /// <param name="fileInfo">The file on the harddrive which contents to include.</param>
        /// <param name="fileName">The name to use on the target machine.</param>
        private void AddFile(IncludeRule rule, System.IO.FileInfo fileInfo, string fileName)
        {
            var dir = this.InstallationDirectory;

            if (!string.IsNullOrEmpty(rule.Folder))
            {
                dir = dir.AddSubDirectory(rule.Folder);
            }

            if (string.IsNullOrEmpty(fileName))
            {
                fileName = fileInfo.Name;
            }

            var outputFile = dir.AddFile(fileName, fileInfo.FullName, rule);

            if (!string.IsNullOrEmpty(rule.StartMenuShortcut))
            {
                this.AddShortcut(rule.StartMenuShortcut, outputFile, rule);
            }
        }
Exemplo n.º 12
0
 /// <summary>
 /// Add a file to the project output, preserving the filename.
 /// </summary>
 /// <param name="rule">The rule which included the file.</param>
 /// <param name="fileInfo">The file on the harddrive to include.</param>
 private void AddFile(IncludeRule rule, System.IO.FileInfo fileInfo)
 {
     this.AddFile(rule, fileInfo, fileInfo.Name);
 }