public TagPropertyEditorTagDefinition(ContentPropertyData propertySaving, SupportTagsAttribute tagsAttribute) : base(propertySaving, tagsAttribute) { }
/// <summary> /// Sets the tag values on the content property based on the property editor's tags attribute /// </summary> /// <param name="property">The content's Property</param> /// <param name="propertyData">The data that has been submitted to be saved for a content property</param> /// <param name="convertedPropertyValue"> /// If the <see cref="TagValueType"/> is <see cref="TagValueType.FromDelimitedValue"/> then this is expected to be a delimited string, /// otherwise if it is <see cref="TagValueType.CustomTagList"/> then this is expected to be IEnumerable{string} /// </param> /// <param name="attribute"></param> public static void SetPropertyTags(Property property, ContentPropertyData propertyData, object convertedPropertyValue, SupportTagsAttribute attribute) { //check for a custom definition if (attribute.TagPropertyDefinitionType != null) { //try to create it TagPropertyDefinition def; try { def = (TagPropertyDefinition)Activator.CreateInstance(attribute.TagPropertyDefinitionType, propertyData, attribute); } catch (Exception ex) { LogHelper.Error <TagExtractor>("Could not create custom " + attribute.TagPropertyDefinitionType + " tag definition", ex); throw; } SetPropertyTags(property, convertedPropertyValue, def.Delimiter, def.ReplaceTags, def.TagGroup, attribute.ValueType, def.StorageType); } else { SetPropertyTags(property, convertedPropertyValue, attribute.Delimiter, attribute.ReplaceTags, attribute.TagGroup, attribute.ValueType, attribute.StorageType); } }