Exemple #1
0
        public void AddHelpOption(Action <PageContentOptionSettings> settings = null)
        {
            PageContentOptionSettings contentOptionSettings = null;

            if (settings != null)
            {
                contentOptionSettings = new PageContentOptionSettings();

                settings(contentOptionSettings);
            }

            PageRenderer.AppendOption(PageContentRowFormattingStyle.None,
                                      Constants.HelpOptionString, contentOptionSettings);
        }
        public void AddOption <TOption>(Expression <Func <TCommand, TOption> > propertySelector,
                                        Action <PageContentOptionSettings> settings = null)
        {
            PageContentOptionSettings contentOptionSettings = null;

            if (settings != null)
            {
                contentOptionSettings = new PageContentOptionSettings();

                settings(contentOptionSettings);
            }

            var option = _options.Get(propertySelector);

            if (option == null)
            {
                throw new OptionCouldNotBeFoundException(propertySelector.GetPropertyInfos()[0]);
            }

            PageRenderer.AppendOption(PageContentRowFormattingStyle.Indent,
                                      option.ToString(), contentOptionSettings);
        }