TaskMasterOptions.AddOption C# (CSharp) Method

AddOption() public method

Adds a dictionary value
public AddOption ( string optionName, string optionValue = "" ) : void
optionName string
optionValue string
return void
    public void AddOption(string optionName, string optionValue = "")
    {
        _optionMapper.Add(optionName, optionValue);
    }

Usage Example

Beispiel #1
0
    /// <summary>
    /// Helper: Adds a command line parameter (if it exists) to the Options colleciton
    /// </summary>
    /// <param name="options"></param>
    /// <param name="optionKey"></param>
    /// <param name="commandLine"></param>
    /// <param name="commandLineKey"></param>
    private static void helper_AddValueIfExists(TaskMasterOptions options, string optionKey, CommandLineParser commandLine, string commandLineKey)
    {
        var commandlineValue = commandLine.GetParameterValue(commandLineKey);

        if (!string.IsNullOrWhiteSpace(commandlineValue))
        {
            options.AddOption(optionKey, commandlineValue);
        }
    }
All Usage Examples Of TaskMasterOptions::AddOption