/// <summary> /// Determines whether the property type is invariant. /// </summary> public static bool VariesByNothing(this PublishedPropertyType propertyType) => propertyType.Variations.VariesByNothing();
public override bool IsConverter(PublishedPropertyType propertyType) { return(Guid.Parse(Constants.PropertyEditors.TinyMCEv3).Equals(propertyType.PropertyEditorGuid)); }
public override object ConvertSourceToXPath(PublishedPropertyType propertyType, object source, bool preview) { // source should come from ConvertSource and be a string (or null) already return(source); }
public override bool IsConverter(PublishedPropertyType propertyType) { return Umbraco.Core.Constants.PropertyEditors.MarkdownEditorAlias.Equals(propertyType.PropertyEditorAlias); }
public Type GetPropertyValueType(PublishedPropertyType propertyType) { var wrappedPropertyType = GetWrappedPropertyType(propertyType); return(wrappedPropertyType != null ? wrappedPropertyType.ClrType : typeof(string)); }
/// <summary> /// Convert the source array into a Video object /// </summary> /// <param name="propertyType"> /// The published property type. /// </param> /// <param name="source"> /// The value of the property /// </param> /// <param name="preview"> /// The preview. /// </param> /// <returns> /// The <see cref="object"/>. /// </returns> public object ConvertSourceToObject(PublishedPropertyType propertyType, object source, bool preview) { var selectedVideos = new SimpleYouTube(source as List <SelectedVideo>); return(selectedVideos); }
public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType) => PropertyCacheLevel.None;
public Type GetPropertyValueType(PublishedPropertyType propertyType) => typeof(int);
public PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType) => _cacheLevel;
public override bool IsConverter(PublishedPropertyType propertyType) { return(propertyType.PropertyEditorAlias.Equals("EnkelMedia.SeoVisualizer")); }
public bool IsConverter(PublishedPropertyType propertyType) => propertyType.EditorAlias.InvariantEquals("Umbraco.Void");
public override Type GetGraphQLType(PublishedPropertyType propertyType) { return(typeof(GridGraphType)); }
public override bool IsConverter(PublishedPropertyType propertyType) { return(propertyType.PropertyEditorAlias == Constants.PropertyEditors.GridAlias); }
/// <summary> /// Determines whether the property type varies by culture. /// </summary> public static bool VariesByCulture(this PublishedPropertyType propertyType) => propertyType.Variations.VariesByCulture();
public override bool IsConverter(PublishedPropertyType propertyType) { return(propertyType.PropertyEditorAlias.Equals("Imulus.UrlPicker")); }
public object ConvertSourceToIntermediate(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview) { SourceConverts++; return(int.TryParse(source as string, out int i) ? i : 0); }
public override object ConvertDataToSource(PublishedPropertyType propertyType, object source, bool preview) { if (source == null) { return(new UrlPicker.Umbraco.Models.UrlPicker()); } var sourceString = source.ToString(); if (sourceString.DetectIsJson()) { try { var urlPicker = JsonConvert.DeserializeObject <Models.UrlPicker>(sourceString); var helper = new UmbracoHelper(UmbracoContext.Current); if (urlPicker.TypeData.ContentId != null) { urlPicker.TypeData.Content = helper.TypedContent(urlPicker.TypeData.ContentId); } if (urlPicker.TypeData.MediaId != null) { urlPicker.TypeData.Media = helper.TypedMedia(urlPicker.TypeData.MediaId); } switch (urlPicker.Type) { case Models.UrlPicker.UrlPickerTypes.Content: if (urlPicker.TypeData.Content != null) { urlPicker.Url = urlPicker.TypeData.Content.Url; urlPicker.UrlAbsolute = urlPicker.TypeData.Content.UrlAbsolute(); urlPicker.Name = (urlPicker.Meta.Title.IsNullOrWhiteSpace()) ? urlPicker.TypeData.Content.Name : urlPicker.Meta.Title; } break; case Models.UrlPicker.UrlPickerTypes.Media: if (urlPicker.TypeData.Media != null) { urlPicker.Url = urlPicker.TypeData.Media.Url; urlPicker.UrlAbsolute = urlPicker.TypeData.Media.Url(); urlPicker.Name = (urlPicker.Meta.Title.IsNullOrWhiteSpace()) ? urlPicker.TypeData.Media.Name : urlPicker.Meta.Title; } break; default: urlPicker.Url = urlPicker.TypeData.Url; urlPicker.UrlAbsolute = urlPicker.TypeData.Url; urlPicker.Name = (urlPicker.Meta.Title.IsNullOrWhiteSpace()) ? urlPicker.TypeData.Url : urlPicker.Meta.Title; break; } return(urlPicker); } catch (Exception ex) { LogHelper.Error <UrlPickerValueConverter>(ex.Message, ex); return(new UrlPicker.Umbraco.Models.UrlPicker()); } } return(sourceString); }
public object ConvertIntermediateToObject(IPublishedElement owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview) { InterConverts++; return((int)inter); }
public override object ConvertIntermediateToXPath(IPublishedElement owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview) { return null; }
public object ConvertIntermediateToXPath(IPublishedElement owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview) => ((int)inter).ToString();
/// <summary> /// The is converter. /// </summary> /// <param name="propertyType"> /// The property type. /// </param> /// <returns> /// The <see cref="bool"/>. /// </returns> public override bool IsConverter(PublishedPropertyType propertyType) { return(!string.IsNullOrEmpty(propertyType.PropertyEditorAlias) && EditorAliases.Contains(propertyType.PropertyEditorAlias)); }
public override bool IsConverter(PublishedPropertyType propertyType) { }
public override bool IsConverter(PublishedPropertyType propertyType) { return(propertyType.PropertyEditorAlias.Equals("Codery.TextCount")); }
public override Type GetPropertyValueType(PublishedPropertyType propertyType) { }
public override object ConvertSourceToObject(PublishedPropertyType propertyType, object source, bool preview) { var wrappedPropertyType = GetWrappedPropertyType(propertyType); return(wrappedPropertyType != null?wrappedPropertyType.ConvertSourceToObject(source, preview) : source); }
/// <summary> /// Specifies the alias of the property editor the converter acts upon. /// </summary> /// <param name="propertyType">Type of the property.</param> /// <returns></returns> public override bool IsConverter(PublishedPropertyType propertyType) { return(propertyType.PropertyEditorAlias == "Escc.Umbraco.PropertyEditors.RichTextPropertyEditor"); }
public override object ConvertSourceToObject(PublishedPropertyType propertyType, object source, bool preview) { // source should come from ConvertSource and be a string (or null) already return(new HtmlString(source == null ? string.Empty : (string)source)); }
public bool IsConverter(PublishedPropertyType propertyType) { return(propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.TextboxMultipleAlias)); }
/// <summary> /// Checks if this converter can convert the property editor and registers if it can. /// </summary> /// <param name="propertyType"> /// The published property type. /// </param> /// <returns> /// The <see cref="bool"/>. /// </returns> public bool IsConverter(PublishedPropertyType propertyType) { return(propertyType.PropertyEditorAlias.Equals("YouTube.Channel")); }
/// <summary> /// Determines whether the property type varies by segment. /// </summary> public static bool VariesBySegment(this PublishedPropertyType propertyType) => propertyType.Variations.VariesBySegment();