public void AddContainer(IOptionContainer optionContainer) { if (_optionContainerLookup.ContainsKey(optionContainer)) { throw new Exception("An options container should only be added once."); } List <OptionDefinition> options = new List <OptionDefinition>(); options.AddRange(optionContainer.GetOptions()); _optionContainerLookup.Add(optionContainer, options); if (optionContainer.IsDynamic) { var handler = new OptionContainerEventHandler(this, optionContainer); _optionContainerEventHandlerLookup.Add(optionContainer, handler); } if (options.Count > 0) { _options.AddRange(options); OnOptionsUpdated(); } }
/// <summary> /// Add multiple options to the output /// </summary> /// <remarks>Can only be called if the active tag is "section"</remarks> /// <param name="optionContainer">Container with all the options /// for the program to document</param> public void AddOptions(IOptionContainer optionContainer) { BeginOptions(); foreach (OptionDefinition opt in optionContainer.GetOptions()) { AddOption(opt); } EndOptions(); }
/// <summary> /// Add multiple options to the output /// </summary> /// <remarks>Can only be called if the active tag is "section"</remarks> /// <param name="optionContainer">Container with all the options /// for the program to document</param> public void AddOptions(IOptionContainer optionContainer) { BeginOptions(); foreach (OptionDefinition opt in optionContainer.GetOptions()) AddOption(opt); EndOptions(); }