Created
March 28, 2018 15:54
-
-
Save leekelleher/7f0a83577985e67185e7086cafc29ad0 to your computer and use it in GitHub Desktop.
Umbraco Forms - Value Converter for the "Form Picker" property-editor, used to define the value type as a `Guid`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Umbraco.Core.Models.PublishedContent; | |
using Umbraco.Core.PropertyEditors; | |
namespace Our.Umbraco.Web.PropertyEditors | |
{ | |
public class UmbracoFormsPickerValueConverter : PropertyValueConverterBase, IPropertyValueConverterMeta | |
{ | |
public override bool IsConverter(PublishedPropertyType propertyType) | |
{ | |
return propertyType.PropertyEditorAlias.Equals("UmbracoForms.FormPicker"); | |
} | |
public PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType, PropertyCacheValue cacheValue) | |
{ | |
return PropertyCacheLevel.Content; | |
} | |
public Type GetPropertyValueType(PublishedPropertyType propertyType) | |
{ | |
return typeof(Guid); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment