Click or drag to resize
OSIsoft, LLC

AFEventFrameFindEventFrames Method (AFDatabase, AFEventFrame, AFSearchMode, Object, Object, String, String, AFCategory, AFElementTemplate, AFDurationQuery, Boolean, AFSortField, AFSortOrder, Int32, Int32)

Note: This API is now obsolete.

Retrieves a paged list of AFEventFrame objects that match the specified filtering conditions.

Namespace:  OSIsoft.AF.EventFrame
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 2.10.8.440
Syntax
[BrowsableAttribute(false)]
[ObsoleteAttribute("This method has been replaced by the 'AFEventFrameSearch' class using the 'Root', 'Start', 'End', 'Name', 'ElementName', 'Category', 'Template', and 'Duration' filters.")]
public static AFNamedCollectionList<AFEventFrame> FindEventFrames(
	AFDatabase database,
	AFEventFrame searchRoot,
	AFSearchMode searchMode,
	Object startTime,
	Object endTime,
	string nameFilter,
	string referencedElementNameFilter,
	AFCategory elemCategory,
	AFElementTemplate elemTemplate,
	AFDurationQuery[] durationQuery,
	bool searchFullHierarchy,
	AFSortField sortField,
	AFSortOrder sortOrder,
	int startIndex,
	int maxCount
)

Parameters

database
Type: OSIsoft.AFAFDatabase
The AFDatabase to search for the requested objects.
searchRoot
Type: OSIsoft.AF.EventFrameAFEventFrame
The root object to start the search. If , then the search starts at the AFDatabase.
searchMode
Type: OSIsoft.AF.AssetAFSearchMode
Determines how the startTime and endTime parameters are treated when searching for event frame objects to be included in the returned collection.
startTime
Type: SystemObject
An object representing the starting time for the search. The startTime must be less than or equal to the endTime. The searchMode parameter will control whether the comparison will be performed against the event frame's StartTime or EndTime. The value may be an AFTime, DateTime, PITime, String, or numeric. A DateTime (or a DATE will be treated as UTC time if its Kind property is set to Unspecified. Because DATE values from COM or VB6 clients are marshalled as Unspecified, these client applications must convert to UTC prior to marshalling. An integer numeric represents the number of ticks (100-nanosecond intervals) since January 1, 0001. A floating point numeric represents the number of seconds since January 1, 1970 UTC. A String is interpreted as local time, unless it contains a time zone indicator such as a trailing "Z" or "GMT". Strings will be interpreted with the AFTime.Parse Overload methods so that relative formats with intervals ("*", "T+3h", etc.) are also supported. Relative time intervals are based on the object's QueryDate.
endTime
Type: SystemObject
An object representing the ending time for the search. The endTime must be greater than or equal to the startTime. The searchMode parameter will control whether the comparison will be performed against the event frame's StartTime or EndTime. The value may be an AFTime, DateTime, PITime, String, or numeric. A DateTime (or a DATE will be treated as UTC time if its Kind property is set to Unspecified. Because DATE values from COM or VB6 clients are marshalled as Unspecified, these client applications must convert to UTC prior to marshalling. An integer numeric represents the number of ticks (100-nanosecond intervals) since January 1, 0001. A floating point numeric represents the number of seconds since January 1, 1970 UTC. A String is interpreted as local time, unless it contains a time zone indicator such as a trailing "Z" or "GMT". Strings will be interpreted with the AFTime.Parse Overload methods so that relative formats with intervals ("*", "T+3h", etc.) are also supported. Relative time intervals are based on the object's QueryDate.
nameFilter
Type: SystemString
The event frame name filter string used for finding objects.

The query string (or match pattern) can include regular characters and wildcard characters. Regular characters must match exactly the characters specified in the query string. Wildcard characters can be matched with arbitrary fragments of the query string. Wildcard characters can be escaped using the single backslash (\) character. Use a double backslash (\\) to match a single backslash. The syntax of the query string has the following rules:

  • If or empty string, then everything will be matched.
  • If no wildcards, then an exact match on the query string is performed.
  • Wildcard * can be placed anywhere in the query string and matches zero or more characters.
  • Wildcard ? can be placed anywhere in the query string and matches exactly one character.
  • One character in a set of characters are matched by placing them within [ ]. For example, a[bc] would match 'ab' or 'ac', but it would not match 'ad' or 'abd'.
  • One character in a set of characters are not matched by placing them within [! ]. For example, a[!bc] would match 'ad', but it would not match 'ab', 'ac', or 'abd'.
  • A character in a range of characters from first to last are matched using the following syntax: [first - last]. For example, a[a-c] would match 'aa', 'ab', or 'ac', but it would not match 'ad' or 'abc'.

referencedElementNameFilter
Type: SystemString
The name filter string of an AFElement in the event frame's ReferencedElements collection. Uses same filtering rules as specified for the nameFilter parameter. To obtain an exact match to a specific element, specify the element's ID using a format that includes the opening and closing braces, such as ID.ToString("B").
elemCategory
Type: OSIsoft.AFAFCategory
Specify that returned event frames must have this category. To not filter by event frame category, then specify for this parameter.
elemTemplate
Type: OSIsoft.AF.AssetAFElementTemplate
Specify that returned event frames must have this template or a template derived from this template. To not filter by event frame template, then specify for this parameter.
durationQuery
Type: OSIsoft.AF.EventFrameAFDurationQuery
An array of duration queries that are ANDed together to find the desired AFEventFrame objects. To not filter by duration, set this parameter to .
searchFullHierarchy
Type: SystemBoolean
Specifies if the search should include objects nested further than the immediate children of the searchRoot.
sortField
Type: OSIsoft.AFAFSortField
The field or property of the object used to sort the returned collection. This value should not be changed between calls when attempting to get the next page of items.
sortOrder
Type: OSIsoft.AFAFSortOrder
The order that the returned collection is sorted. This value should not be changed between calls when attempting to get the next page of items.
startIndex
Type: SystemInt32
The starting index (zero based) of the items to be returned.
maxCount
Type: SystemInt32
The maximum number of objects to be returned per call (the page size).

Return Value

Type: AFNamedCollectionListAFEventFrame
Returns a collection containing the specified page of AFEventFrame objects which match the specified nameFilter string and filters.
Remarks

An event frame must be saved to the server using ApplyChanges or CheckIn before it will be returned by this find method. This method will return a list of event frames within a time range.

This will only return objects of type AFEventFrame. Types of event frames that inherit from AFEventFrame will not be returned. Use the specific find methods to return types of event frames that inherit from AFEventFrame.

Important note Important
Consider using the new AFEventFrameSearch class for finding event frames instead of using this method.

Version Information

AFSDK

Supported in: 2.8.5, 2.8, 2.7.5, 2.7, 2.6, 2.5, 2.4
Obsolete (compiler warning) in 2.10.5
Obsolete (compiler warning) in 2.10
Obsolete (compiler warning) in 2.9.5
Obsolete (compiler warning) in 2.9
See Also
Enabling Operational Intelligence