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

AF SDK Reference

PIServers.Item Property (String)

  • Last UpdatedNov 18, 2025
  • 3 minute read
PIServers.Item Property (String)
Returns the specified object from the collection by name.

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

Syntax

public PIServer this[
	string name
] { get; }
Public ReadOnly Default Property Item ( 
	name As String
) As PIServer
	Get

Dim instance As PIServers
Dim name As String
Dim value As PIServer

value = instance(name)
public:
property PIServer^ default[String^ name] {
	PIServer^ get (String^ name);
}
member Item : PIServer with get

Parameters

name
Type: SystemString
Specifies the collection member by name. It must be equal to the Name property of a member of the collection.

Property Value

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

Exceptions

ExceptionCondition
IndexOutOfRangeException Thrown when the specified index is out of range.

Remarks

The Item property is intended to be used to retrieve a specific object in the collection by the specified name. 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[name].

If the name 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.

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

Note Notes to Callers
Only the AFElements and AFAttributes collections support looking up items in the collection by name and path. All other collections only support looking up items by name.

Version Information

AFSDK


See Also

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