Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

IAFNamedCollection(T).Item Property (Guid)

  • Last UpdatedNov 18, 2025
  • 2 minute read
IAFNamedCollection(T).Item Property (Guid)
Gets the item with the specified id.

Namespace:  OSIsoft.AF
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

T this[
	Guid id
] { get; }
ReadOnly Default Property Item ( 
	id As Guid
) As T
	Get

Dim instance As IAFNamedCollection
Dim id As Guid
Dim value As T

value = instance(id)
property T default[Guid id] {
	T get (Guid id);
}
abstract Item : 'T with get

Parameters

id
Type: SystemGuid
The id whose item to get.

Property Value

Type: T
The item with the specified id. If the specified id is not found, attempting to get it returns the default value for the item type T.

Remarks

The Item property is intended to be used to retrieve a specific object in the collection by the specified id. If you want to enumerate the collection, you can use the GetEnumerator property in the standard way. With Microsoft® Visual Basic® and C#, this property is automatically used within For Each In constructs. This property provides the ability to access a specified item in the collection by using the following syntax: myCollection[id].

If the id is not found, then this property returns the appropriate default value for the item type T; for example, zero (0) for integer types, for Boolean types, and for reference types.

If the collection has a lookup dictionary, the ids in the dictionary are compared with the specified id. If there is no lookup dictionary, the id of each item is first extracted and then compared with the specified id.

Retrieving the value of this property is an O(1) operation.

Version Information

AFSDK


See Also

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in