public FirstCharGroupingFunction(MediaItemAspectMetadata.AttributeSpecification attributeType)
 {
   _attributeType = attributeType;
   if (_emptyOrMiscCharacterGroupName == null)
     _emptyOrMiscCharacterGroupName = LocalizationHelper.Translate(EMPTY_OR_MISC_CHAR_GROUP_NAME_RES);
   // TODO: How to get all valid letters in all variants (with umlauts etc.)?
   _letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
 }
 /// <summary>
 /// Creates a new <see cref="ComplexAttributeQueryBuilder"/> instance.
 /// </summary>
 /// <param name="miaManagement">MIAM management instance from media library.</param>
 /// <param name="complexQueryAttribute">Complex attribute, which is requested by this query. Only attributes
 /// with a cardinality different from <see cref="Cardinality.Inline"/> are allowed here.</param>
 /// <param name="selectProjectionFunction">This delegate function will be called for the selected attribute.
 /// It must return an SQL projection expression whose return value is the requested value for that attribute.
 /// If this delegate function is <c>null</c>, the actual attribute is selected without a projection function.</param>
 /// <param name="necessaryRequestedMIAs">MIAs which must be present for the media item to match the query.</param>
 /// <param name="filter">Filter which must be applied to the media items to match the query.</param>
 public ComplexAttributeQueryBuilder(
     MIA_Management miaManagement,
     MediaItemAspectMetadata.AttributeSpecification complexQueryAttribute,
     SelectProjectionFunction selectProjectionFunction,
     IEnumerable<MediaItemAspectMetadata> necessaryRequestedMIAs, IFilter filter) : base(miaManagement)
 {
   _queryAttribute = complexQueryAttribute;
   _selectProjectionFunction = selectProjectionFunction;
   _necessaryRequestedMIAs = necessaryRequestedMIAs;
   _filter = filter;
 }
 public CompiledGroupedAttributeValueQuery(
     MIA_Management miaManagement,
     IEnumerable<MediaItemAspectMetadata> necessaryRequestedMIATypes,
     MediaItemAspectMetadata.AttributeSpecification selectedAttribute, IAttributeFilter selectAttributeFilter,
     SelectProjectionFunction selectProjectionFunction, Type projectionValueType,
     IFilter filter)
 {
   _miaManagement = miaManagement;
   _necessaryRequestedMIATypes = necessaryRequestedMIATypes;
   _selectAttribute = selectedAttribute;
   _selectAttributeFilter = selectAttributeFilter;
   _selectProjectionFunction = selectProjectionFunction;
   _projectionValueType = projectionValueType;
   _filter = filter;
 }
 public SimpleMLFilterCriterion(MediaItemAspectMetadata.AttributeSpecification attributeType)
 {
   _attributeType = attributeType;
 }
示例#5
0
 public QueryAttribute(MediaItemAspectMetadata.AttributeSpecification attr)
 {
   _attr = attr;
 }
示例#6
0
 /// <summary>
 /// Sets the collection attribute of type <paramref name="attributeSpecification"/> for this
 /// media item aspect.
 /// </summary>
 /// <remarks>
 /// A call to this method automatically resets the "ignore" flag for the given attribute.
 /// </remarks>
 /// <param name="attributeSpecification">Attribute type to set.</param>
 /// <param name="value">Enumeration of values to be set to the specified attribute.</param>
 /// <exception cref="ArgumentException">Thrown if an attribute type is specified which is not defined on this
 /// MIA's metadata or if the most specific type of all elements in the <paramref name="value"/> enumeration
 /// doesn't match the defined type in the <paramref name="attributeSpecification"/>.</exception>
 public void SetCollectionAttribute(MediaItemAspectMetadata.AttributeSpecification attributeSpecification, IEnumerable value)
 {
     CheckCollectionAttribute(attributeSpecification);
     _aspectData[attributeSpecification] = value;
 }
示例#7
0
 protected object CheckString(MediaItemAspectMetadata.AttributeSpecification attributeSpecification, string str)
 {
     return(str == null || str.Length <= attributeSpecification.MaxNumChars ? str :
            str.Substring(0, (int)attributeSpecification.MaxNumChars));
 }
示例#8
0
 public void Ignore(MediaItemAspectMetadata.AttributeSpecification attributeSpecification)
 {
     _aspectData[attributeSpecification] = IGNORE;
 }
示例#9
0
 public bool IsIgnore(MediaItemAspectMetadata.AttributeSpecification attributeSpecification)
 {
     return(ReferenceEquals(_aspectData[attributeSpecification], IGNORE));
 }
示例#10
0
 private static bool SpecificationsAreEqual(MediaItemAspect aspect, MultipleMediaItemAspect value, MediaItemAspectMetadata.AttributeSpecification spec)
 {
     if (aspect[spec] == null)
     {
         return(value[spec] == null);
     }
     return(aspect[spec].Equals(value[spec]));
 }