コード例 #1
0
 /// <summary>
 /// Constructor specifies the defaults and sets the ContentPropertyData being used to set the tag values which
 /// can be used to dynamically adjust the tags definition for this property.
 /// </summary>
 /// <param name="propertySaving"></param>
 /// <param name="tagsAttribute"></param>
 protected TagPropertyDefinition(ContentPropertyData propertySaving, SupportTagsAttribute tagsAttribute)
 {
     PropertySaving = propertySaving;
     TagsAttribute = tagsAttribute;
     Delimiter = tagsAttribute.Delimiter;
     ReplaceTags = tagsAttribute.ReplaceTags;
     TagGroup = tagsAttribute.TagGroup;
 }
コード例 #2
0
        /// <summary>
        /// Constructor specifies the defaults and sets the ContentPropertyData being used to set the tag values which
        /// can be used to dynamically adjust the tags definition for this property.
        /// </summary>
        /// <param name="propertySaving"></param>
        /// <param name="tagsAttribute"></param>
        protected TagPropertyDefinition(ContentPropertyData propertySaving, SupportTagsAttribute tagsAttribute)
        {
            PropertySaving = propertySaving;
            TagsAttribute  = tagsAttribute;
            Delimiter      = tagsAttribute.Delimiter;
            ReplaceTags    = tagsAttribute.ReplaceTags;
            TagGroup       = tagsAttribute.TagGroup;

            var preValues = propertySaving.PreValues.PreValuesAsDictionary;

            StorageType = preValues.ContainsKey("storageType") && preValues["storageType"].Value == TagCacheStorageType.Json.ToString() ?
                          TagCacheStorageType.Json : TagCacheStorageType.Csv;
        }
コード例 #3
0
 /// <summary>
 /// Sets the tag values on the content property based on the property editor's tags attribute
 /// </summary>
 /// <param name="content"></param>
 /// <param name="property"></param>
 /// <param name="propertyData"></param>
 /// <param name="convertedPropertyValue"></param>
 /// <param name="attribute"></param>
 public static void SetPropertyTags(IContentBase content, 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(content, property, convertedPropertyValue, def.Delimiter, def.ReplaceTags, def.TagGroup, attribute.ValueType);
     }
     else
     {
         SetPropertyTags(content, property, convertedPropertyValue, attribute.Delimiter, attribute.ReplaceTags, attribute.TagGroup, attribute.ValueType);
     }
 }
コード例 #4
0
 public TagPropertyEditorTagDefinition(ContentPropertyData propertySaving, SupportTagsAttribute tagsAttribute)
     : base(propertySaving, tagsAttribute)
 {
 }