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

AF SDK Reference

Product Family
Current publication
Table of Contents

PISystems.Item Property (String)

PISystems.Item Property (String)
Returns the specified object from the collection by name.

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

Syntax

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

Dim instance As PISystems
Dim name As String
Dim value As PISystem

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

Parameters

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

Property Value

Type: PISystem
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, false for Boolean types, and null 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

Was this topic helpful?