Exemplo n.º 1
0
        /// <summary>
        /// Get the path of the directory containing the executable file.
        /// </summary>
        public static string GetExecutableFileDirectoryPath(this IExecutableFilePathProvider executableFilePathProvider, IStringlyTypedPathOperator stringlyTypedPathOperator)
        {
            var executableFilePath = executableFilePathProvider.GetExecutableFilePath();

            var executableFileDirectoryPath = stringlyTypedPathOperator.GetDirectoryPathForFilePath(executableFilePath);

            return(executableFileDirectoryPath);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Performs special solution directory path-relative formatting.
        /// </summary>
        public static string GetProjectFilePath(this IStringlyTypedPathOperator stringlyTypedPathOperator, string solutionFilePath, string projectFileRelativePath)
        {
            var solutionFileDirectoryPath = stringlyTypedPathOperator.GetDirectoryPathForFilePath(solutionFilePath);

            var projectFilePath = stringlyTypedPathOperator.Combine(solutionFileDirectoryPath, projectFileRelativePath);

            return(projectFilePath);
        }
Exemplo n.º 3
0
        public FileFormattedMessageSink(IStringlyTypedPathOperator stringlyTypedPathOperator, string messagesOutputFilePath)
        {
            // Create the directory if it does not exist.
            var messagesOutputDirectoryPath = stringlyTypedPathOperator.GetDirectoryPathForFilePath(messagesOutputFilePath);

            DirectoryHelper.CreateDirectoryOkIfExists(messagesOutputDirectoryPath);

            // Delete the output file path, if it exists.
            FileHelper.DeleteOnlyIfExists(messagesOutputFilePath);

            this.MessagesOutputFilePath = messagesOutputFilePath;
        }