2using System.Reflection;
9 [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple =
true, Inherited =
true)]
12 private readonly
string indexCollection;
14 private readonly
bool hasPropertyDefinitions;
15 private readonly
bool isPropertyReference;
49 this.indexCollection = IndexCollection;
51 this.hasPropertyDefinitions = (
Properties?.Length ?? 0) > 0;
52 this.isPropertyReference =
false;
67 this.indexCollection = IndexCollection;
69 this.hasPropertyDefinitions = (this.
Properties?.Length ?? 0) > 0;
70 this.isPropertyReference = PropertyReference;
83 if (this.isPropertyReference)
85 Type T = Reference.GetType();
86 PropertyInfo PI = T.GetRuntimeProperty(this.indexCollection)
87 ??
throw new ArgumentException(
"Object lacks a property named " + this.indexCollection, nameof(Reference));
89 object Obj = PI.GetValue(Reference);
94 throw new ArgumentException(
"Object property " + this.indexCollection +
" does not return a string.", nameof(Reference));
97 return this.indexCollection;
This attribute defines that objects of this type should be indexed in the full-text-search index.
FullTextSearchAttribute(string IndexCollection, params PropertyDefinition[] Properties)
This attribute defines that objects of this type should be indexed in the full-text-search index.
PropertyDefinition[] Properties
Array of property (or field) definitions used to index objects of this type.
FullTextSearchAttribute(string IndexCollection, params string[] Properties)
This attribute defines that objects of this type should be indexed in the full-text-search index.
FullTextSearchAttribute(string IndexCollection)
This attribute defines that objects of this type should be indexed in the full-text-search index.
bool DynamicIndexCollection
If the index collection is dynamic (i.e. depends on object instance).
FullTextSearchAttribute(string IndexCollection, bool PropertyReference)
This attribute defines that objects of this type should be indexed in the full-text-search index.
bool HasPropertyDefinitions
If property names are defined for this class (true), or if objects are to be tokenized using a specia...
string GetIndexCollection(object Reference)
Name of full-text-search index collection.
Defines an indexable property.