IPropertyCollection.Item property
Gets or sets a string value that stores, alters, or accesses properties.
Namespace: Microsoft.SharePoint.Search.Query
Assembly: Microsoft.SharePoint.Search (in Microsoft.SharePoint.Search.dll)
Syntax
'Declaration
Default Property Item ( _
key As String _
) As Object
Get
Set
'Usage
Dim instance As IPropertyCollection
Dim key As String
Dim value As Object
value = instance(key)
instance(key) = value
Object this[
string key
] { get; set; }
Parameters
key
Type: System.StringThe key of the property to access. It is case insensitive.
Property value
Type: System.Object
The value for the requested property as an object reference. It will have the same underlying type of the value that was stored in the property in the first place.
Exceptions
Exception | Condition |
---|---|
ArgumentException | The key is null or empty. |
ArgumentException | The value is an unsupported type. (Check if a type is supported by using the IsSupported method.) |
KeyNotFoundException | A property with the specified key is not found in the QueryProperties instance. |
FieldAccessException | The property being set has an internal/private setter. |
Remarks
Every property available on the class via property syntax, such as Properties.QueryText, will also be available via the accessor (for example, Properties["QueryText"]).