public CommandlineArgument(CommandlineParameterId commandlineParameterId, ParseArgumentDelegate parseArgumentDelegate, object defaultValue) { this.parameter = defaultValue; this.valid = false; this.commandlineParameterId = commandlineParameterId; this.parseArgumentDelegate = parseArgumentDelegate; }
public CommandlineParameters() { // Sanity check for (CommandlineParameterId id = 0; id < CommandlineParameterId.Count; id++) { AppAssert.Assert(this.CommandlineParameterTable[(int)id].ParameterId == id, "CommandlineParameterTable is incorrectly initialized", String.Format("{0} != {1}", this.CommandlineParameterTable[(int)id].ParameterId, id)); } }
private static ParseArgumentDelegate CreateCredentialArgumentParser(CommandlineParameterId id) { return(delegate(CommandlineArgument commandlineArgument, String[] arguments, ref int index) { string parmeterName = Enum.GetName(typeof(CommandlineParameterId), id); if (ConsumeArgument(commandlineArgument, arguments[index], parmeterName)) { if (FetchValue(commandlineArgument, arguments, index)) { index++; arguments[index] = (String)commandlineArgument.Parameter; SetupLogger.LogInfo("{0} received", parmeterName); index++; return true; } } return false; }); }
public bool IsParameterSpecified(CommandlineParameterId commandlineParameterId) { return(this.CommandlineParameterTable[(int)commandlineParameterId].Valid); }
public void SetParameterValue(CommandlineParameterId commandlineParameterId, object input) { this.CommandlineParameterTable[(int)commandlineParameterId].Parameter = input; }
public object GetParameterValue(CommandlineParameterId commandlineParameterId) { return(this.CommandlineParameterTable[(int)commandlineParameterId].Parameter); }