public ApplicationOptionParameter(ApplicationParameterModel pModel, OptionModel model, String optionName, String optionValue, Object optionValueTyped) : base(pModel) { this._model = model; this._optionName = optionName ?? ""; this._optionValue = optionValue ?? ""; this._optionValueTyped = optionValueTyped; }
private static AbstractApplicationParameter ProcessParameterModel(ApplicationParameterModel p, ApplicationParametersModel paramsModel, IList <String> args, IList <String> argsListReadOnly, IList <ValidationError> errors, ref Int32 idx) { var arg = args[idx]; if (p.Expandable) { var eArgs = TryExpandArgumentsRecursively(paramsModel.ParameterParser, arg); if (eArgs != null) { // Expanded successfully args.RemoveAt(idx); for (var i = eArgs.Count - 1; i >= 0; --i) { args.Insert(idx, eArgs[i]); } // Read-only list should reflect the changed list } } AbstractApplicationParameter pInstance = null; if (idx < args.Count) { arg = args[idx]; foreach (var optionModel in p.PossibleOptions) { String on, ov, errorMsg; Object ovt; var oldIdx = idx; idx += paramsModel.ParameterParser.TryParseOption(argsListReadOnly, idx, optionModel, out on, out ov, out ovt, out errorMsg); if (idx > oldIdx) { pInstance = new ApplicationOptionParameter(p, optionModel, on, ov, ovt); if (errorMsg != null) { errors.Add(new ValidationError(on, errorMsg)); } break; } } if (pInstance == null && p.CanBeNonOption) { pInstance = new ApplicationValueParameter(p, arg); idx += 1; } } return(pInstance); }
internal ApplicationValueParameter(ApplicationParameterModel parameterModel, String value) : base(parameterModel) { this._value = value; }
public AbstractApplicationParameter(ApplicationParameterModel parameterModel) { this._parameterModel = parameterModel; }