Пример #1
0
 /// <summary>
 /// Constructor for wrapping ITagQuery, see http://issues.umbraco.org/issue/U4-6899
 /// </summary>
 /// <param name="wrappedQuery"></param>
 internal TagQuery(ITagQuery wrappedQuery)
 {
     if (wrappedQuery == null)
     {
         throw new ArgumentNullException("wrappedQuery");
     }
     _wrappedQuery = wrappedQuery;
 }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of <see cref="UmbracoHelper"/>.
 /// </summary>
 /// <param name="currentPage">The <see cref="IPublishedContent"/> item assigned to the helper.</param>
 /// <param name="tagQuery"></param>
 /// <param name="cultureDictionary"></param>
 /// <param name="componentRenderer"></param>
 /// <param name="publishedContentQuery"></param>
 /// <param name="membershipHelper"></param>
 /// <remarks>Sets the current page to the context's published content request's content item.</remarks>
 public UmbracoHelper(IPublishedContent currentPage,
                      ITagQuery tagQuery,
                      ICultureDictionaryFactory cultureDictionary,
                      IUmbracoComponentRenderer componentRenderer,
                      IPublishedContentQuery publishedContentQuery,
                      MembershipHelper membershipHelper)
 {
     _tagQuery = tagQuery ?? throw new ArgumentNullException(nameof(tagQuery));
     _cultureDictionaryFactory = cultureDictionary ?? throw new ArgumentNullException(nameof(cultureDictionary));
     _componentRenderer        = componentRenderer ?? throw new ArgumentNullException(nameof(componentRenderer));
     _membershipHelper         = membershipHelper ?? throw new ArgumentNullException(nameof(membershipHelper));
     _publishedContentQuery    = publishedContentQuery ?? throw new ArgumentNullException(nameof(publishedContentQuery));
     _currentPage = currentPage;
 }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UmbracoHelper"/> class.
 /// </summary>
 /// <remarks>For tests.</remarks>
 internal UmbracoHelper(UmbracoContext umbracoContext, IPublishedContent content,
                        ITagQuery tagQuery,
                        ICultureDictionary cultureDictionary,
                        IUmbracoComponentRenderer componentRenderer,
                        MembershipHelper membershipHelper,
                        ServiceContext services)
 {
     _umbracoContext    = umbracoContext ?? throw new ArgumentNullException(nameof(umbracoContext));
     _tag               = tagQuery ?? throw new ArgumentNullException(nameof(tagQuery));
     _cultureDictionary = cultureDictionary ?? throw new ArgumentNullException(nameof(cultureDictionary));
     _componentRenderer = componentRenderer ?? throw new ArgumentNullException(nameof(componentRenderer));
     _membershipHelper  = membershipHelper ?? throw new ArgumentNullException(nameof(membershipHelper));
     _currentPage       = content ?? throw new ArgumentNullException(nameof(content));
     _services          = services ?? throw new ArgumentNullException(nameof(services));
 }
Пример #4
0
 public TagController(IContentService contentService, ITagQuery tagService)
 {
     _contentService = contentService;
     _tagService     = tagService;
 }
Пример #5
0
 public TagsDataController(ITagQuery tagQuery)
 {
     _tagQuery = tagQuery ?? throw new ArgumentNullException(nameof(tagQuery));
 }
Пример #6
0
 public TagsDataController(ITagQuery tagQuery) =>
Пример #7
0
 public static UmbracoHelper GetUmbracoHelper(UmbracoContext context, ICultureDictionary cultureDictionary = null, MembershipHelper membershipHelper = null, UrlProvider urlProvider = null,
                                              IPublishedContent content = null, ITypedPublishedContentQuery typedQuery = null, IDynamicPublishedContentQuery dynamicQuery            = null, ITagQuery tagQuery = null, IDataTypeService typeService = null,
                                              IUmbracoComponentRenderer componentRenderer = null)
 {
     return(new UmbracoHelper(context,
                              content ?? Mock.Of <IPublishedContent>(),
                              typedQuery ?? Mock.Of <ITypedPublishedContentQuery>(),
                              dynamicQuery ?? Mock.Of <IDynamicPublishedContentQuery>(),
                              tagQuery ?? Mock.Of <ITagQuery>(),
                              typeService ?? Mock.Of <IDataTypeService>(),
                              urlProvider ?? GetUmbracoUrlProvider(context),
                              cultureDictionary ?? Mock.Of <ICultureDictionary>(),
                              componentRenderer ?? Mock.Of <IUmbracoComponentRenderer>(),
                              membershipHelper ?? GetUmbracoMembershipHelper(context)));
 }