public BreadcrumbTagHelper(BreadcrumbManager breadcrumbManager, IUrlHelperFactory urlHelperFactory,
                                   IActionContextAccessor actionContextAccessor, HtmlEncoder htmlEncoder)
        {
            _breadcrumbManager = breadcrumbManager;
            _htmlEncoder       = htmlEncoder;
            _urlHelper         = urlHelperFactory.GetUrlHelper(actionContextAccessor.ActionContext);
            IStringLocalizerFactory factory = (IStringLocalizerFactory)actionContextAccessor.ActionContext.HttpContext.RequestServices.GetService(typeof(IStringLocalizerFactory));

            if (factory != null && BreadcrumbManager.Options.ResourceType != null)
            {
                _localizer = factory.Create(BreadcrumbManager.Options.ResourceType);
            }
        }
Пример #2
0
        public BreadcrumbTagHelper(BreadcrumbManager breadcrumbManager, IUrlHelperFactory urlHelperFactory,
                                   IActionContextAccessor actionContextAccessor, HtmlEncoder htmlEncoder)
        {
            _breadcrumbManager = breadcrumbManager;
            _htmlEncoder       = htmlEncoder;
            _urlHelper         = urlHelperFactory.GetUrlHelper(actionContextAccessor.ActionContext);
            IStringLocalizerFactory factory = (IStringLocalizerFactory)actionContextAccessor.ActionContext.HttpContext.RequestServices.GetService(typeof(IStringLocalizerFactory));

            if (factory != null && BreadcrumbManager.Options.ResourceType != null)
            {
                var type         = BreadcrumbManager.Options.ResourceType;
                var assemblyName = new AssemblyName(type.GetTypeInfo().Assembly.FullName);
                _localizer = factory.Create(BreadcrumbManager.Options.ResourceType.Name, assemblyName.Name);
            }
        }
Пример #3
0
 public BreadcrumbTagHelper(BreadcrumbManager breadcrumbManager, IUrlHelperFactory urlHelperFactory, IActionContextAccessor actionContextAccessor)
 {
     _breadcrumbManager = breadcrumbManager;
     _urlHelper         = urlHelperFactory.GetUrlHelper(actionContextAccessor.ActionContext);
 }