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

AF SDK Reference

AFEventFrameSearch.FindEventFrames Method

  • Last UpdatedNov 18, 2025
  • 6 minute read
AFEventFrameSearch.FindEventFrames Method

Note: This API is now obsolete.

This method will return the AFEventFrame objects that match the search tokens.

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

Syntax

[BrowsableAttribute(false)]
[ObsoleteAttribute("This method has been replaced by FindObjects.")]
public IEnumerable<AFEventFrame> FindEventFrames(
	int startIndex = 0,
	bool fullLoad = false,
	int pageSize = 0
)
<BrowsableAttribute(false)>
<ObsoleteAttribute("This method has been replaced by FindObjects.")>
Public Function FindEventFrames ( 
	Optional startIndex As Integer = 0,
	Optional fullLoad As Boolean = false,
	Optional pageSize As Integer = 0
) As IEnumerable(Of AFEventFrame)

Dim instance As AFEventFrameSearch
Dim startIndex As Integer
Dim fullLoad As Boolean
Dim pageSize As Integer
Dim returnValue As IEnumerable(Of AFEventFrame)

returnValue = instance.FindEventFrames(startIndex, 
	fullLoad, pageSize)
public:
[BrowsableAttribute(false)]
[ObsoleteAttribute(L"This method has been replaced by FindObjects.")]
IEnumerable<AFEventFrame^>^ FindEventFrames(
	int startIndex = 0, 
	bool fullLoad = false, 
	int pageSize = 0
)
[<BrowsableAttribute(false)>]
[<ObsoleteAttribute("This method has been replaced by FindObjects.")>]
member FindEventFrames : 
        ?startIndex : int * 
        ?fullLoad : bool * 
        ?pageSize : int 
(* Defaults:
        let _startIndex = defaultArg startIndex 0
        let _fullLoad = defaultArg fullLoad false
        let _pageSize = defaultArg pageSize 0
*)
-> IEnumerable<AFEventFrame> 

Parameters

startIndex (Optional)
Type: SystemInt32
The starting index (zero based) of the items to be returned.
fullLoad (Optional)
Type: SystemBoolean
If , then the returned objects will be full loaded. If , then the returned objects may not be fully loaded and will require another call to the server if additional information about the object is requested that is not already loaded.
pageSize (Optional)
Type: SystemInt32
The page size used for retrieving objects from the server. If this parameter is less than or equal to zero, then the page size will be set to the current value of the CollectionPageSize setting.

Return Value

Type: IEnumerableAFEventFrame
Returns an enumerable list of the event frames found using the search tokens for this search object.

Exceptions

ExceptionCondition
FormatException This exception is thrown if the ThrowOnError property is and there is a format error in the search query.
NotSupportedException This exception is thrown if the ThrowOnError property is and one of the filters is not supported or the query is too complex to be evaluated by the server.

Examples

 1// Get the Database
 2PISystems myPISystems = new PISystems();
 3PISystem myPISystem = myPISystems.DefaultPISystem;
 4if (myPISystem == null)
 5    throw new InvalidOperationException("Default PISystem was not found.");
 6AFDatabase myDB = myPISystem.Databases[dbName];
 7if (myDB == null)
 8    throw new InvalidOperationException("Database was not found.");
 9
10// Create a search to find all the event frames created from the 'Event'
11// template, with a start time greater than or equal to three days ago,
12// and its 'Level' attribute value is greater than or equal 45.
13// Note: Time strings must be in a format supported by AFTime.Parse which
14//       will use current culture and then fall back to invariant culture.
15int count;
16using (var search = new AFEventFrameSearch(myDB, "FindEvents", @"Template:'Event' Start:>='*-3d' |Level:>=45.0"))
17{
18    search.CacheTimeout = TimeSpan.FromMinutes(10);
19
20    // When the event frames are returned from a find operation, they are only
21    // partially loaded into memory, typically enough to display their 
22    // inherent properties, such as Name, Description, Template, etc.  
23    // When a piece of information is accessed in the event frame that requires more 
24    // information, an RPC to the server is made to fully load the event frame.  
25    // By having the search do a full load, all information is loaded in bulk and
26    // we can reduce the number of RPCs made to retrieve this information.
27    count = search.GetTotalCount();
28    Console.WriteLine("Found {0} EventFrames.", count);
29    foreach (AFEventFrame item in search.FindObjects(fullLoad: true))
30    {
31        // Now we can use the event frames without having to make any additional RPCs
32        // In the example below, accessing the Attributes collection would have 
33        // caused an additional RPC per element found.
34        // Now we can use the event frames without having to make any additional RPCs
35        // In the example below, accessing the Attributes collection would have 
36        // caused an additional RPC per event frame found.
37        Console.WriteLine("  EventFrame {0} has {1} Attributes", item.Name, item.Attributes.Count);
38    }
39}
 1' Get the Database
 2Dim myPISystems As New PISystems()
 3Dim myPISystem As PISystem = myPISystems.DefaultPISystem
 4If myPISystem Is Nothing Then
 5    Throw New InvalidOperationException("Default PISystem was not found.")
 6End If
 7Dim myDB As AFDatabase = myPISystem.Databases(dbName)
 8If myDB Is Nothing Then
 9    Throw New InvalidOperationException("Database was not found.")
10End If
11
12' Create a search to find all the event frames created from the 'Event'
13' template, with a start time greater than or equal to three days ago,
14' and its 'Level' attribute value is greater than or equal 45.
15' Note: Time Strings must be in a format supported by AFTime.Parse which
16'       will use current culture And then fall back to invariant culture.
17Dim count As Integer
18Using search As New AFEventFrameSearch(myDB, "FindEvents", "Template:'Event' Start:>='*-3d' |Level:>=45.0")
19
20    search.CacheTimeout = TimeSpan.FromMinutes(10)
21
22    ' When the event frames are returned from a find operation, they are only
23    ' partially loaded into memory, typically enough to display their 
24    ' inherent properties, such as Name, Description, Template, etc.  
25    ' When a piece of information is accessed in the event frame that requires more 
26    ' information, an RPC to the server is made to fully load the event frame.  
27    ' By having the search do a full load, all information is loaded in bulk and
28    ' we can reduce the number of RPCs made to retrieve this information.
29    count = search.GetTotalCount()
30    Console.WriteLine("Found {0} EventFrames.", count)
31    For Each item As AFEventFrame In search.FindObjects(fullLoad:=True)
32        ' Now we can use the event frames without having to make any additional RPCs
33        ' In the example below, accessing the Attributes collection would have 
34        ' caused an additional RPC per element found.
35        ' Now we can use the event frames without having to make any additional RPCs
36        ' In the example below, accessing the Attributes collection would have 
37        ' caused an additional RPC per event frame found.
38        Console.WriteLine("  EventFrame {0} has {1} Attributes", item.Name, item.Attributes.Count)
39    Next
40End Using

No code example is currently available or this language may not be supported.

No code example is currently available or this language may not be supported.

Version Information

AFSDK

Supported in: 2.10.0, 2.10, 2.9.5, 2.9, 2.8.5, 2.8
Obsolete (compiler warning) in 3.1.1
Obsolete (compiler warning) in 3.1.0
Obsolete (compiler warning) in 3.0.2
Obsolete (compiler warning) in 3.0.1
Obsolete (compiler warning) in 3.0.0
Obsolete (compiler warning) in 2.10.11
Obsolete (compiler warning) in 2.10.5

See Also

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