Posted By

patriksvenssonmpsbroadbandcom on 05/16/11


Tagged

MPP PropertyFilter


Versions (?)

PropertyFilter code ref document


 / Published in: C#
 

Snippet from the code ref. explaining PropertiesFilter in FindContent

  1. /// <summary>
  2. /// Filter on content properties. There are two types of filters; simple and advanced. The advanced one is used
  3. /// if the properties in the filter are to contain special characters, i.e. other characters than a-z,A-Z,0-9,_,=,#.
  4. /// The property filter is a logical expression combining properties
  5. /// You can use && (AND), || (OR), ( ) (parenthesis) and ! (NOT) in expressions. Optional parameter.
  6. /// <para>
  7. /// Note that spaces within a simple property filter must be replaced by # (hash mark/number sign). If not, the expression parser will fail.
  8. /// </para>
  9. /// <para>
  10. /// Example on expression syntax for simple filters:
  11. /// !Type=Film && (Actor=Tom#Hanks || Category=Toplist)
  12. /// </para>
  13. /// <para>
  14. /// For advanced filters, when special characters are used, the <see cref="FindContentParameters.PropertiesFilterParameters"/>
  15. /// list must be used to send the property matchings. %1, %2, etc are placeholders for the
  16. /// property parameter.
  17. /// </para>
  18. /// <para>
  19. /// Example on expression syntax for complex filters:
  20. /// !%1 && (%2 || %3)
  21. /// where %1 is a <see cref="PropertiesFilterParameter"/> with <see cref="PropertiesFilterParameter.PropertyName"/> set to Tå|p and
  22. /// <see cref="PropertiesFilterParameter.PropertyMatchString"/> is set to F!lm etc.
  23. /// </para>
  24. /// </summary>
  25. // NON-XML-doc example: !Type=Film && (Actor=Tom#Hanks || Category=Toplist)
  26. [DataMember(IsRequired = true)]
  27. public String PropertiesFilter;
  28.  
  29. /// <summary>
  30. /// When advanced property filters are used where the properties contain special characters,
  31. /// see <see cref="FindContentParameters.PropertiesFilter"/>,
  32. /// this list must be filled with the properties. The first value in the list matches the
  33. /// placeholder %1, the second one %2, etc. The values in this list can contain any character
  34. /// </summary>
  35. [DataMember]
  36. public List<PropertiesFilterParameter> PropertiesFilterParameters;

Report this snippet  

You need to login to post a comment.