Пример #1
0
        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();
            }
        }
Пример #2
0
 /// <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();
 }
Пример #3
0
		/// <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();
		}