public AlphaPagerTagHelper(
            IUrlHelper urlHelper,
            IHtmlGenerator generator)
        {
            Generator = generator;

        }
예제 #2
0
 public PdfOutputController(IHtmlGenerator htmlGenerator, IPdfGenerator pdfGenerator, IStorageProvider storageProvider, IFilenameGenerator filenameGenerator)
 {
     this.htmlGenerator = htmlGenerator;
     this.pdfGenerator = pdfGenerator;
     this.storageProvider = storageProvider;
     this.filenameGenerator = filenameGenerator;
 }
        public AdminFormAttribute(InputType inputType, string label, string options ="" )
        {
            _htmlGenerator = new HtmlGenerator.HtmlGenerator();

            InputType = inputType;
            Label = label;
            Options =(string.IsNullOrWhiteSpace(options))?null :options.Split(new []{','}).ToList();
        }
예제 #4
0
        public TopicMiddleware(Func<IDictionary<string, object>, Task> inner, DocProject project, IHtmlGenerator generator, DocSettings settings)
        {
            _inner = inner;
            _project = project;
            _generator = generator;
            _settings = settings;

            var stream = Assembly.GetExecutingAssembly()
                .GetManifestResourceStream(typeof(TopicMiddleware), "WebsocketsRefresh.txt");

            _webSocketScript = stream.ReadAllText();
            _topicJS = Assembly.GetExecutingAssembly().GetManifestResourceStream(typeof(Program),"topics.js").ReadAllText();
        }
예제 #5
0
        public TopicMiddleware(DocProject project, IHtmlGenerator generator, DocSettings settings)
        {
            _project = project;
            _generator = generator;
            _settings = settings;

            var topicAssembly = typeof(TopicMiddleware).GetAssembly();

            var stream = topicAssembly.GetManifestResourceStream("dotnet-stdocs.Runner.WebsocketsRefresh.txt");

            _webSocketScript = stream.ReadAllText();
            _topicJS = topicAssembly.GetManifestResourceStream("dotnet-stdocs.topics.js").ReadAllText();
        }
예제 #6
0
        public static ViewContext GetViewContext(
            object model,
            IHtmlGenerator htmlGenerator,
            IModelMetadataProvider metadataProvider)
        {
            var actionContext = new ActionContext(new DefaultHttpContext(), new RouteData(), new ActionDescriptor());
            var viewData = new ViewDataDictionary(metadataProvider)
            {
                Model = model,
            };
            var viewContext = new ViewContext(
                actionContext,
                Mock.Of<IView>(),
                viewData,
                Mock.Of<ITempDataDictionary>(),
                TextWriter.Null);

            return viewContext;
        }
 public NavLinkTagHelper(IHtmlGenerator generator)
     : base(generator)
 {
 }
예제 #8
0
 /// <summary>
 /// Creates a new <see cref="AnchorTagHelper"/>.
 /// </summary>
 /// <param name="generator">The <see cref="IHtmlGenerator"/>.</param>
 public AnchorTagHelper(IHtmlGenerator generator)
 {
     Generator = generator;
 }
예제 #9
0
 /// <summary>
 /// Creates a new <see cref="TextAreaTagHelper"/>.
 /// </summary>
 /// <param name="generator">The <see cref="IHtmlGenerator"/>.</param>
 public TextAreaTagHelper(IHtmlGenerator generator)
 {
     Generator = generator;
 }
예제 #10
0
        private static InputTagHelper GetTagHelper(
            IHtmlGenerator htmlGenerator,
            object container,
            Type containerType,
            object model,
            string propertyName,
            string expressionName,
            IModelMetadataProvider metadataProvider = null)
        {
            if (metadataProvider == null)
            {
                metadataProvider = new TestModelMetadataProvider();
            }

            var containerMetadata = metadataProvider.GetMetadataForType(containerType);
            var containerExplorer = metadataProvider.GetModelExplorerForType(containerType, container);

            var propertyMetadata = metadataProvider.GetMetadataForProperty(containerType, propertyName);
            var modelExplorer = containerExplorer.GetExplorerForExpression(propertyMetadata, model);

            var modelExpression = new ModelExpression(expressionName, modelExplorer);
            var viewContext = TestableHtmlGenerator.GetViewContext(container, htmlGenerator, metadataProvider);
            var inputTagHelper = new InputTagHelper(htmlGenerator)
            {
                For = modelExpression,
                ViewContext = viewContext,
            };

            return inputTagHelper;
        }
예제 #11
0
 /// <summary>
 /// Creates a new <see cref="FormTagHelper"/>.
 /// </summary>
 /// <param name="generator">The <see cref="IHtmlGenerator"/>.</param>
 public FormTagHelper(IHtmlGenerator generator)
 {
     Generator = generator;
 }
 void IHtmlFormattingController.WriteSlideEnd(IHtmlGenerator generator, ISlide slide)
 {
     generator.AddHtml(SlideFooter);
 }
 /// <summary>
 /// Creates a new <see cref="ValidationMessageTagHelper"/>.
 /// </summary>
 /// <param name="generator">The <see cref="IHtmlGenerator"/>.</param>
 public ValidationMessageTagHelper(IHtmlGenerator generator)
 {
     Generator = generator;
 }
예제 #14
0
 public DateBoxHelper(IHtmlGenerator htmlGenerator, HtmlEncoder htmlEncoder)
 {
     this._htmlGenerator = htmlGenerator;
     this._htmlEncoder   = htmlEncoder;
 }
예제 #15
0
 public PaginationTagHelper(IHtmlGenerator generator)
 {
     this.Generator     = generator;
     this.paginationTag = new TagBuilder("div");
     this.paginationTag.AddCssClass("pagination");
 }
예제 #16
0
 public DropdownHelper(IHtmlGenerator generator)
 {
     _generator = generator;
 }
예제 #17
0
 /// <summary>
 /// 创建新的验证标签
 /// </summary>
 /// <param name="generator"></param>
 public ValidationSummaryTagHelper(IHtmlGenerator generator)
 {
     this.Generator = generator;
 }
예제 #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ButtonTagHelper"/> class.
 /// </summary>
 /// <param name="generator">The current html generator</param>
 public ButtonTagHelper(IHtmlGenerator generator)
 {
     Generator = generator;
 }
예제 #19
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="generator">HTML generator</param>
 /// <param name="htmlHelper">HTML helper</param>
 public AppActionConfirmationTagHelper(IHtmlGenerator generator, IHtmlHelper htmlHelper)
 {
     Generator   = generator;
     _htmlHelper = htmlHelper;
 }
예제 #20
0
 public RadioButtonsTag(IHtmlGenerator generator)
     : base(generator)
 {
     InputTypeName = "radio";
     Inline        = true;      // set as default for radiobuttons...
 }
예제 #21
0
 public NopLabelTagHelper(IHtmlGenerator generator, ILocalizationService localizationService, IWorkContext workContext)
 {
     Generator            = generator;
     _localizationService = localizationService;
     _workContext         = workContext;
 }
 public LabelDescriptionTagHelper(IHtmlGenerator generator)
 {
     Generator = generator;
 }
 void IHtmlFormattingController.WriteDocumentEnd(IHtmlGenerator generator, IPresentation presentation)
 {}
예제 #24
0
 public InputTagHelper(IHtmlGenerator generator) : base(generator)
 {
 }
예제 #25
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="generator">HTML generator</param>
 public AgsLabelTagHelper(IHtmlGenerator generator)
 {
     Generator = generator;
 }
예제 #26
0
        private static HtmlHelper <TModel> GetHtmlHelper <TModel>(
            ViewDataDictionary <TModel> viewData,
            IUrlHelper urlHelper,
            ICompositeViewEngine viewEngine,
            IModelMetadataProvider provider,
            Func <IHtmlHelper, IHtmlHelper> innerHelperWrapper,
            IHtmlGenerator htmlGenerator,
            string idAttributeDotReplacement)
        {
            var httpContext   = new DefaultHttpContext();
            var actionContext = new ActionContext(httpContext, new RouteData(), new ActionDescriptor());

            var options = new MvcViewOptions();

            if (!string.IsNullOrEmpty(idAttributeDotReplacement))
            {
                options.HtmlHelperOptions.IdAttributeDotReplacement = idAttributeDotReplacement;
            }
            var localizationOptionsAccesor = new Mock <IOptions <MvcDataAnnotationsLocalizationOptions> >();

            localizationOptionsAccesor.SetupGet(o => o.Value).Returns(new MvcDataAnnotationsLocalizationOptions());

            options.ClientModelValidatorProviders.Add(new DataAnnotationsClientModelValidatorProvider(
                                                          localizationOptionsAccesor.Object,
                                                          stringLocalizerFactory: null));
            var optionsAccessor = new Mock <IOptions <MvcViewOptions> >();

            optionsAccessor
            .SetupGet(o => o.Value)
            .Returns(options);

            var serviceProvider = new Mock <IServiceProvider>();

            serviceProvider
            .Setup(s => s.GetService(typeof(ICompositeViewEngine)))
            .Returns(viewEngine);
            serviceProvider
            .Setup(s => s.GetService(typeof(IUrlHelper)))
            .Returns(urlHelper);
            serviceProvider
            .Setup(s => s.GetService(typeof(IViewComponentHelper)))
            .Returns(new Mock <IViewComponentHelper>().Object);
            serviceProvider
            .Setup(s => s.GetService(typeof(IViewComponentHelper)))
            .Returns(new Mock <IViewComponentHelper>().Object);

            httpContext.RequestServices = serviceProvider.Object;
            if (htmlGenerator == null)
            {
                htmlGenerator = new DefaultHtmlGenerator(
                    Mock.Of <IAntiforgery>(),
                    optionsAccessor.Object,
                    provider,
                    urlHelper,
                    new CommonTestEncoder());
            }

            // TemplateRenderer will Contextualize this transient service.
            var innerHelper = (IHtmlHelper) new HtmlHelper(
                htmlGenerator,
                viewEngine,
                provider,
                new CommonTestEncoder(),
                new UrlEncoder(),
                new JavaScriptStringEncoder());

            if (innerHelperWrapper != null)
            {
                innerHelper = innerHelperWrapper(innerHelper);
            }
            serviceProvider
            .Setup(s => s.GetService(typeof(IHtmlHelper)))
            .Returns(() => innerHelper);

            var htmlHelper = new HtmlHelper <TModel>(
                htmlGenerator,
                viewEngine,
                provider,
                new CommonTestEncoder(),
                new UrlEncoder(),
                new JavaScriptStringEncoder());

            var viewContext = new ViewContext(
                actionContext,
                Mock.Of <IView>(),
                viewData,
                new TempDataDictionary(
                    new HttpContextAccessor(),
                    Mock.Of <ITempDataProvider>()),
                new StringWriter(),
                options.HtmlHelperOptions);

            htmlHelper.Contextualize(viewContext);

            return(htmlHelper);
        }
예제 #27
0
 public Exporter(DocSettings settings, IHtmlGenerator generator)
 {
     _settings = settings;
     _generator = generator;
 }
예제 #28
0
 public DynamicFormTagHelper(IHtmlGenerator htmlGenerator, HtmlEncoder encoder, IHtmlHelper htmlHelper)
 {
     _htmlGenerator = htmlGenerator;
     _encoder       = encoder;
     _htmlHelper    = htmlHelper;
 }
 public TableTagHelper(IHtmlGenerator generator)
 {
     Generator = generator;
 }
예제 #30
0
 public PropertySearchTagHelper(IHtmlGenerator generator) : base(generator, "div", TagMode.StartTagAndEndTag)
 {
 }
 //Obtain an HTML genertor so we can use it to generate labels, validation
 public FormGroupWrapperTagHelper(IHtmlGenerator generator)
 {
     Generator = generator;
 }
예제 #32
0
 public FormGroupTagHelper(IHtmlGenerator htmlGenerator)
 {
     _htmlGenerator = htmlGenerator;
 }
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="generator">HTML generator</param>
 public NopNestedSettingTagHelper(IHtmlGenerator generator)
 {
     Generator = generator;
 }
예제 #34
0
 public InputPasswordTagHelper(IHtmlGenerator generator)
 {
     Generator = generator;
 }
예제 #35
0
 public PagerTagHelper(IHtmlGenerator htmlGenerator)
 {
     this.HtmlGenerator = htmlGenerator;
 }
예제 #36
0
 public LabelTagHelper(IHtmlGenerator generator) : base(generator)
 {
 }
예제 #37
0
 public SampleTagHelper(IHtmlGenerator generator) : base(generator)
 {
 }
예제 #38
0
 public OrderLinkTagHelper(IHtmlGenerator generator) : base(generator)
 {
     //utilizzato per sfruttare la capacità del tag anchor di generare link
 }
 public SelectTagHelper(IHtmlGenerator generator)
 {
     Generator = generator;
 }
예제 #40
0
 /// <summary>
 /// Creates a new <see cref="OptionTagHelper"/>.
 /// </summary>
 /// <param name="generator">The <see cref="IHtmlGenerator"/>.</param>
 public OptionTagHelper(IHtmlGenerator generator)
 {
     Generator = generator;
 }
 void IHtmlFormattingController.WriteSlideStart(IHtmlGenerator generator, ISlide slide)
 {
     generator.AddHtml(string.Format(SlideHeader, generator.SlideIndex + 1));
 }
예제 #42
0
 public AntiForgeryTokenTagHelper(IHtmlGenerator generator)
 {
     Generator = generator;
 }
 void IHtmlFormattingController.WriteShapeEnd(IHtmlGenerator generator, IShape shape)
 {}
예제 #44
0
 /// <summary>
 /// コンストラクタ
 /// </summary>
 /// <param name="generator">The <see cref="IHtmlGenerator"/>.</param>
 public VueInputTagHelper(IHtmlGenerator generator)
 {
     Generator = generator;
 }
예제 #45
0
 /// <summary>
 /// Creates a new <see cref="OptionTagHelper"/>.
 /// </summary>
 /// <param name="generator">The <see cref="IHtmlGenerator"/>.</param>
 public OptionTagHelper(IHtmlGenerator generator)
 {
     Generator = generator;
 }
예제 #46
0
 public DropDownListTag(IHtmlGenerator generator)
 {
     _generator = generator;
 }
예제 #47
0
 /// <summary>
 /// Creates a new <see cref="ValidationSummaryTagHelper"/>.
 /// </summary>
 /// <param name="generator">The <see cref="IHtmlGenerator"/>.</param>
 public ValidationSummaryTagHelper(IHtmlGenerator generator)
 {
     Generator = generator;
 }
예제 #48
0
 public AbpInputTagHelperService(IHtmlGenerator generator, HtmlEncoder encoder, IAbpTagHelperLocalizer tagHelperLocalizer)
 {
     _generator          = generator;
     _encoder            = encoder;
     _tagHelperLocalizer = tagHelperLocalizer;
 }
예제 #49
0
 private static InputTagHelper GetTagHelper(
     IHtmlGenerator htmlGenerator,
     object model,
     string propertyName,
     IModelMetadataProvider metadataProvider = null)
 {
     return GetTagHelper(
         htmlGenerator,
         container: new Model(),
         containerType: typeof(Model),
         model: model,
         propertyName: propertyName,
         expressionName: propertyName,
         metadataProvider: metadataProvider);
 }
예제 #50
0
 /// <summary>
 /// Creates a new <see cref="FormTagHelper"/>.
 /// </summary>
 /// <param name="generator">The <see cref="IHtmlGenerator"/>.</param>
 public FormTagHelper(IHtmlGenerator generator)
 {
     Generator = generator;
 }
예제 #51
0
 /// <summary>
 /// Creates a new <see cref="LabelTagHelper"/>.
 /// </summary>
 /// <param name="generator">The <see cref="IHtmlGenerator"/>.</param>
 public LabelTagHelper(IHtmlGenerator generator)
 {
     Generator = generator;
 }
예제 #52
0
 public FieldTagHelper(IHtmlGenerator generator)
 {
     Generator = generator;
 }
예제 #53
0
		public EditorTagHelper(IHtmlGenerator generator) : base(generator) { }
예제 #54
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="generator">HTML generator</param>
 /// <param name="htmlHelper">HTML helper</param>
 public AgsDatePickerTagHelper(IHtmlGenerator generator, IHtmlHelper htmlHelper)
 {
     Generator   = generator;
     _htmlHelper = htmlHelper;
 }
예제 #55
0
 /// <summary>
 /// Creates a new <see cref="InputTagHelper"/>.
 /// </summary>
 /// <param name="generator">The <see cref="IHtmlGenerator"/>.</param>
 public InputTagHelper(IHtmlGenerator generator)
 {
     Generator = generator;
 }
예제 #56
0
 public ImageTagHelper(IHtmlGenerator generator)
 {
     Generator = generator;
 }
예제 #57
0
 public PagerTagHelper(IHtmlGenerator generator, IBuildPaginationLinks linkBuilder)
 {
     Generator = generator;
     this.linkBuilder = linkBuilder;
 }
		public FlagsEnumInputTagHelper(IHtmlGenerator htmlGenerator)
		{
			HtmlGenerator = htmlGenerator;
		}
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="generator">HTML generator</param>
 /// <param name="htmlHelper">HTML helper</param>
 public QNetDeleteConfirmationTagHelper(IHtmlGenerator generator, IHtmlHelper htmlHelper)
 {
     Generator   = generator;
     _htmlHelper = htmlHelper;
 }
예제 #60
0
 public NavLinkTagHelper(IHtmlGenerator generator)
     : base(generator)
 {
 }