public void AddError(ParsingError error) { if (error == null) throw new ArgumentNullException("error"); lock (SyncObject) { ParsingErrors.Add(error); } }
private static void BuildAndSetPostParsingStateIfNeeded(object options, OptionInfo option, bool? required, bool? mutualExclusiveness) { var commandLineOptionsBase = options as CommandLineOptionsBase; if (commandLineOptionsBase == null) return; var error = new ParsingError { BadOption = { ShortName = option.ShortName, LongName = option.LongName } }; if (required != null) error.ViolatesRequired = required.Value; if (mutualExclusiveness != null) error.ViolatesMutualExclusiveness = mutualExclusiveness.Value; (commandLineOptionsBase).InternalLastPostParsingState.AddError(error); }