Exemple #1
0
        /// <summary>
        /// Adds a global variable to the provider
        /// </summary>
        /// <param name="name">The name of the variable</param>
        /// <param name="value">The variable value</param>
        public void AddGlobal(string name, string value)
        {
            Precondition.NotNullOrEmpty(name, "name");
            Precondition.NotNullOrEmpty(value, "value");

            variables[name] = value;
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CommandLineConversionProcessor"/> class.
        /// </summary>
        /// <param name="executablePath">The path to the executable to call</param>
        /// <param name="outputFolderName">The destination folder used to generate the output file name</param>
        /// <param name="outputFileExtension">The extension to use when renaming the output file</param>
        /// <param name="commandLineTemplate">The command line template to use.  This should contain 2 variables {0} and {1}.
        /// Where {0} represents the input file, and {1} will be replaced with the output file</param>
        public CommandLineConversionProcessor(
            string executablePath,
            string outputFolderName,
            string outputFileExtension,
            string commandLineTemplate)
        {
            Precondition.NotNullOrEmpty(executablePath, "executablePath");
            Precondition.NotNullOrEmpty(outputFolderName, "outputFolderName");
            Precondition.NotNullOrEmpty(outputFileExtension, "outputFileExtension");
            Precondition.NotNullOrEmpty(commandLineTemplate, "commandLineTemplate");

            Precondition.Assert(() => File.Exists(executablePath), "Invalid executablePath");

            Logger.InfoFormat("Executable Path:       '{0}'", executablePath);
            Logger.InfoFormat("Output Folder Name:    '{0}'", outputFolderName);
            Logger.InfoFormat("Output File Extension: '{0}'", outputFileExtension);
            Logger.InfoFormat("Command Line       :   '{0}'", commandLineTemplate);

            this.outputDirectoryInfo = new DirectoryInfo(outputFolderName);
            this.commandLineTemplate = commandLineTemplate;
            this.executablePath      = executablePath;
            this.outputFileExtension = outputFileExtension.StartsWith(".")
                                            ? outputFileExtension
                                            : "." + outputFileExtension;

            if (!this.outputDirectoryInfo.Exists)
            {
                this.outputDirectoryInfo.Create();
            }
        }
Exemple #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MoveFileProcessor"/> class.
        /// </summary>
        /// <param name="destinationDirectory">The destination directory to move the file to</param>
        public MoveFileProcessor(string destinationDirectory)
        {
            Precondition.NotNullOrEmpty(destinationDirectory, "destinationDirectory");

            Logger.InfoFormat("Initialized with a destination directory of '{0}'", destinationDirectory);

            this.destinationDirectoryInfo = new DirectoryInfo(destinationDirectory);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="LaunchApplicationCommand"/> class.
        /// </summary>
        /// <param name="applicationPath">The path to the application to launch</param>
        public LaunchApplicationCommand(string applicationPath)
        {
            Precondition.NotNullOrEmpty(applicationPath, "applicationPath");

            Logger.InfoFormat("Initialized with an application path of '{0}'", applicationPath);

            this.applicationPath = applicationPath;
        }
Exemple #5
0
        public static IEnumerable <KeyValuePair <string, string> > BuildBasicParams(string clientId,
                                                                                    IEnumerable <KeyValuePair <string, string> > passedParameters)
        {
            Precondition.NotNullOrEmpty(clientId, nameof(clientId));

            var parameters = new List <KeyValuePair <string, string> >(8)
            {
                new KeyValuePair <string, string>(OAuthConstants.CLIENT_ID, clientId)
            };

            if (passedParameters != null)
            {
                parameters.AddRange(passedParameters);
            }

            return(parameters);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="DocumentProcessorFactory"/> class.
        /// </summary>
        /// <param name="processorName">The processor name that the factory instance provides</param>
        protected DocumentProcessorFactory(string processorName)
        {
            Precondition.NotNullOrEmpty(processorName, "processorName");

            this.processorName = processorName;
        }