예제 #1
0
 public BentoItemValueConverter(IPublishedSnapshotAccessor publishedSnapshotAccessor)
 {
     _publishedSnapshotAccessor = publishedSnapshotAccessor;
 }
예제 #2
0
 /// <summary>
 /// Initializes a new instance.
 /// </summary>
 /// <param name="publishedSnapshotAccessor">The current published snapshot accessor.</param>
 /// <param name="siteDomainHelper">The current site domain helper.</param>
 public SpaDomainRepository(IPublishedSnapshotAccessor publishedSnapshotAccessor, ISiteDomainHelper siteDomainHelper)
 {
     _publishedSnapshotAccessor = publishedSnapshotAccessor;
     _siteDomainHelper          = siteDomainHelper;
 }
 public static IPublishedPropertyType GetModelPropertyType <TValue>(IPublishedSnapshotAccessor publishedSnapshotAccessor, Expression <Func <Speakers, TValue> > selector)
 => PublishedModelUtility.GetModelPropertyType(GetModelContentType(publishedSnapshotAccessor), selector);
예제 #4
0
        // initializes a published content property with a value
        public Property(IPublishedPropertyType propertyType, PublishedContent content, PropertyData[] sourceValues, IPublishedSnapshotAccessor publishedSnapshotAccessor, PropertyCacheLevel referenceCacheLevel = PropertyCacheLevel.Element)
            : base(propertyType, referenceCacheLevel)
        {
            if (sourceValues != null)
            {
                foreach (var sourceValue in sourceValues)
                {
                    if (sourceValue.Culture == "" && sourceValue.Segment == "")
                    {
                        _sourceValue = sourceValue.Value;
                    }
                    else
                    {
                        if (_sourceValues == null)
                        {
                            _sourceValues = new Dictionary <CompositeStringStringKey, SourceInterValue>();
                        }
                        _sourceValues[new CompositeStringStringKey(sourceValue.Culture, sourceValue.Segment)]
                            = new SourceInterValue {
                            Culture = sourceValue.Culture, Segment = sourceValue.Segment, SourceValue = sourceValue.Value
                            };
                    }
                }
            }

            _contentUid   = content.Key;
            _content      = content;
            _isPreviewing = content.IsPreviewing;
            _isMember     = content.ContentType.ItemType == PublishedItemType.Member;
            _publishedSnapshotAccessor = publishedSnapshotAccessor;
            _variations = propertyType.Variations;
        }
예제 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NestedContentManyValueConverter"/> class.
 /// </summary>
 public NestedContentManyValueConverter(IPublishedSnapshotAccessor publishedSnapshotAccessor, IPublishedModelFactory publishedModelFactory, IProfilingLogger proflog)
     : base(publishedSnapshotAccessor, publishedModelFactory)
 {
     _proflog = proflog;
 }
예제 #6
0
 public ContentNode CloneParent(IPublishedSnapshotAccessor publishedSnapshotAccessor)
 {
     return(new ContentNode(this));
 }
 protected PublishedSnapshotServiceBase(IPublishedSnapshotAccessor publishedSnapshotAccessor, IVariationContextAccessor variationContextAccessor)
 {
     PublishedSnapshotAccessor = publishedSnapshotAccessor;
     VariationContextAccessor  = variationContextAccessor;
 }
예제 #8
0
 public SimpleTreeMenuConverter(IPublishedSnapshotAccessor publishedSnapshotAccessor, IPublishedModelFactory publishedModelFactory) : base(publishedSnapshotAccessor, publishedModelFactory)
 {
     _publishedSnapshotAccessor = publishedSnapshotAccessor;
 }
 public ContentPickerValueConverter(IPublishedSnapshotAccessor publishedSnapshotAccessor) => _publishedSnapshotAccessor = publishedSnapshotAccessor;
예제 #10
0
        //private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor;

        //Injecting the PublishedSnapshotAccessor for fetching content
        public MetaMomentumValueConverter(ILogger logger, IContentService contentService, IPublishedSnapshotAccessor publishedSnapshotAccessor)
        {
            _logger                    = logger;
            _contentService            = contentService;
            _publishedSnapshotAccessor = publishedSnapshotAccessor ?? throw new ArgumentNullException(nameof(publishedSnapshotAccessor));
        }
 public CustomMediaPickerValueConverter(IPublishedSnapshotAccessor publishedSnapshotAccessor, IPublishedModelFactory publishedModelFactory)
     : base(publishedSnapshotAccessor, publishedModelFactory)
 {
     _publishedModelFactory = publishedModelFactory;
 }
 public MultiUrlPickerPropertyEditor(ILogger logger, IEntityService entityService, IPublishedSnapshotAccessor publishedSnapshotAccessor) : base(logger, EditorType.PropertyValue)
 {
     _entityService             = entityService ?? throw new ArgumentNullException(nameof(entityService));
     _publishedSnapshotAccessor = publishedSnapshotAccessor ?? throw new ArgumentNullException(nameof(publishedSnapshotAccessor));
 }
예제 #13
0
 public UmbracoMembersDataListSource(IMemberTypeService memberTypeService, IMemberService memberService, IPublishedSnapshotAccessor publishedSnapshotAccessor)
 {
     _memberTypeService         = memberTypeService;
     _memberService             = memberService;
     _publishedSnapshotAccessor = publishedSnapshotAccessor;
 }
예제 #14
0
 public MemberCache(bool previewDefault, ICacheProvider snapshotCache, IMemberService memberService, IDataTypeService dataTypeService, ILocalizationService localizationService, PublishedContentTypeCache contentTypeCache, IPublishedSnapshotAccessor publishedSnapshotAccessor, IVariationContextAccessor variationContextAccessor)
 {
     _snapshotCache             = snapshotCache;
     _publishedSnapshotAccessor = publishedSnapshotAccessor;
     VariationContextAccessor   = variationContextAccessor;
     _memberService             = memberService;
     _dataTypeService           = dataTypeService;
     _localizationService       = localizationService;
     _previewDefault            = previewDefault;
     _contentTypeCache          = contentTypeCache;
 }
 public MultiUrlPickerValueEditor(IEntityService entityService, IPublishedSnapshotAccessor publishedSnapshotAccessor, ILogger logger, DataEditorAttribute attribute) : base(attribute)
 {
     _entityService             = entityService ?? throw new ArgumentNullException(nameof(entityService));
     _publishedSnapshotAccessor = publishedSnapshotAccessor ?? throw new ArgumentNullException(nameof(publishedSnapshotAccessor));
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
 }
예제 #16
0
 public PublishedElementPropertyBase(PublishedPropertyType propertyType, IPublishedElement element, bool previewing, PropertyCacheLevel referenceCacheLevel, object sourceValue = null, IPublishedSnapshotAccessor publishedSnapshotAccessor = null)
     : base(propertyType, referenceCacheLevel)
 {
     _sourceValue = sourceValue;
     _publishedSnapshotAccessor = publishedSnapshotAccessor;
     Element      = element;
     IsPreviewing = previewing;
     IsMember     = propertyType.ContentType.ItemType == PublishedItemType.Member;
 }
예제 #17
0
        // two-phase ctor, phase 2
        public void SetContentTypeAndData(IPublishedContentType contentType, ContentData draftData, ContentData publishedData, IPublishedSnapshotAccessor publishedSnapshotAccessor, IVariationContextAccessor variationContextAccessor)
        {
            ContentType = contentType;

            if (draftData == null && publishedData == null)
            {
                throw new ArgumentException("Both draftData and publishedData cannot be null at the same time.");
            }

            _publishedSnapshotAccessor = publishedSnapshotAccessor;
            _variationContextAccessor  = variationContextAccessor;

            _draftData     = draftData;
            _publishedData = publishedData;
        }
 public NestedContentElementsValueConverter(IPublishedSnapshotAccessor publishedSnapshotAccessor, IPublishedModelFactory publishedModelFactory, IProfilingLogger proflog)
     : base(publishedSnapshotAccessor, publishedModelFactory, proflog)
 {
 }
예제 #19
0
        // two-phase ctor, phase 2
        public void SetContentTypeAndData(PublishedContentType contentType, ContentData draftData, ContentData publishedData, IPublishedSnapshotAccessor publishedSnapshotAccessor, IVariationContextAccessor variationContextAccessor)
        {
            ContentType = contentType;

            if (draftData == null && publishedData == null)
            {
                throw new ArgumentException("Both draftData and publishedData cannot be null at the same time.");
            }

            if (draftData != null)
            {
                Draft = new PublishedContent(this, draftData, publishedSnapshotAccessor, variationContextAccessor).CreateModel();
            }
            if (publishedData != null)
            {
                Published = new PublishedContent(this, publishedData, publishedSnapshotAccessor, variationContextAccessor).CreateModel();
            }
        }
 public RelatedLinksValueConverter(IPublishedSnapshotAccessor publishedSnapshotAccessor, IUmbracoContextAccessor umbracoContextAccessor, ILogger logger)
 {
     _publishedSnapshotAccessor = publishedSnapshotAccessor;
     _umbracoContextAccessor    = umbracoContextAccessor;
     _logger = logger;
 }
예제 #21
0
 // initializes a published content property with no value
 public Property(IPublishedPropertyType propertyType, PublishedContent content, IPublishedSnapshotAccessor publishedSnapshotAccessor, PropertyCacheLevel referenceCacheLevel = PropertyCacheLevel.Element)
     : this(propertyType, content, null, publishedSnapshotAccessor, referenceCacheLevel)
 {
 }
예제 #22
0
 public SimpleConverter2(IPublishedSnapshotAccessor publishedSnapshotAccessor, PropertyCacheLevel cacheLevel = PropertyCacheLevel.None)
 {
     _publishedSnapshotAccessor = publishedSnapshotAccessor;
     _cacheLevel = cacheLevel;
 }
예제 #23
0
 public BlockEditorConverter(IPublishedSnapshotAccessor publishedSnapshotAccessor, IPublishedModelFactory publishedModelFactory)
 {
     _publishedSnapshotAccessor = publishedSnapshotAccessor;
     _publishedModelFactory     = publishedModelFactory;
 }
예제 #24
0
 public SimpleConverter3B(IPublishedSnapshotAccessor publishedSnapshotAccessor)
 {
     _publishedSnapshotAccessor = publishedSnapshotAccessor;
 }
 public MemberPickerValueConverter(IPublishedSnapshotAccessor publishedSnapshotAccessor)
 {
     _publishedSnapshotAccessor = publishedSnapshotAccessor ?? throw new ArgumentNullException(nameof(publishedSnapshotAccessor));
 }
 public MultiUrlPickerValueConverter(IPublishedSnapshotAccessor publishedSnapshotAccessor, IProfilingLogger proflog)
 {
     _publishedSnapshotAccessor = publishedSnapshotAccessor ?? throw new ArgumentNullException(nameof(publishedSnapshotAccessor));
     _proflog = proflog ?? throw new ArgumentNullException(nameof(proflog));
 }
 /// <inheritdoc />
 public UnestingSingleValueConverter(IPublishedSnapshotAccessor publishedSnapshotAccessor, IPublishedModelFactory publishedModelFactory, IProfilingLogger proflog) : base(publishedSnapshotAccessor, publishedModelFactory, proflog)
 {
 }
예제 #28
0
 protected NestedContentValueConverterBase(IPublishedSnapshotAccessor publishedSnapshotAccessor, IPublishedModelFactory publishedModelFactory)
 {
     _publishedSnapshotAccessor = publishedSnapshotAccessor;
     PublishedModelFactory      = publishedModelFactory;
 }
예제 #29
0
 public new static IPublishedContentType GetModelContentType(IPublishedSnapshotAccessor publishedSnapshotAccessor)
 => PublishedModelUtility.GetModelContentType(publishedSnapshotAccessor, ModelItemType, ModelTypeAlias);
 public FaLinksPropertyValueConverter(IPublishedSnapshotAccessor publishedSnapshotAccessor)
 {
     _publishedSnapshotAccessor = publishedSnapshotAccessor ?? throw new ArgumentNullException(nameof(publishedSnapshotAccessor));
 }