AFEventFrameSearch.FindEventFrames Method
- Last UpdatedJan 12, 2026
- 5 minute read
- PI System
- AF SDK 3.2.0
- Developer
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.2.0.7
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: IEnumerableAFEventFrameReturns an enumerable list of the event frames found using the search tokens for this search object.
Exceptions
| Exception | Condition |
|---|---|
| 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}
Version Information
AFSDK
Supported in: 2.10.0, 2.10, 2.9.5, 2.9, 2.8.5, 2.8Obsolete (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