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

AF SDK Reference

AFEventFrame.LoadEventFramesToDepth Method

  • Last UpdatedNov 18, 2025
  • 4 minute read
AFEventFrame.LoadEventFramesToDepth Method
Loads the specified list AFEventFrame objects and their child event frames to the hierarchical depth specified.

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

Syntax

public static AFNamedCollectionList<AFEventFrame> LoadEventFramesToDepth(
	IList<AFEventFrame> eventFrames,
	bool fullLoad,
	int depth,
	int maxCount
)
Public Shared Function LoadEventFramesToDepth ( 
	eventFrames As IList(Of AFEventFrame),
	fullLoad As Boolean,
	depth As Integer,
	maxCount As Integer
) As AFNamedCollectionList(Of AFEventFrame)

Dim eventFrames As IList(Of AFEventFrame)
Dim fullLoad As Boolean
Dim depth As Integer
Dim maxCount As Integer
Dim returnValue As AFNamedCollectionList(Of AFEventFrame)

returnValue = AFEventFrame.LoadEventFramesToDepth(eventFrames, 
	fullLoad, depth, maxCount)
public:
static AFNamedCollectionList<AFEventFrame^>^ LoadEventFramesToDepth(
	IList<AFEventFrame^>^ eventFrames, 
	bool fullLoad, 
	int depth, 
	int maxCount
)
static member LoadEventFramesToDepth : 
        eventFrames : IList<AFEventFrame> * 
        fullLoad : bool * 
        depth : int * 
        maxCount : int -> AFNamedCollectionList<AFEventFrame> 

Parameters

eventFrames
Type: System.Collections.GenericIListAFEventFrame
The list of root event frames to be loaded. If , then this method does nothing. All event frames in the list must be from the same PISystem.
fullLoad
Type: SystemBoolean
This parameter is ignored and will always perform a full load in this release.
depth
Type: SystemInt32
Specifies the number of levels of the event frame hierarchy to load past the level of the event frames in the collection passed in. For example, a depth parameter of 2 would indicate that all child event frames and grandchild event frames of the specified event frames would be loaded.
maxCount
Type: SystemInt32
Specifies the maximum number of objects to load. Once the maximum number of objects is reached, the load will terminate.

Return Value

Type: AFNamedCollectionListAFEventFrame
The list of event frames returned is a list of all child event frames loaded at all depths. Even though each AFEventFrame in the eventFrames list are loaded, they are not included in the returned list.

Remarks

This method can be used to significantly decrease the time for loading a portion of the event frame hierarchy starting with the AFEventFrame objects in the specified list. Each AFEventFrame in the list will be loaded along with their child event frames and the referenced elements in each event frame's ReferencedElements collection from the server into the client.
Important note Important
If the AFCache is disabled, then this method will automatically set the KeepInMemory property of each collection of child EventFrames to prevent them from being garbage collected.
Important note Important
Partially loading the AFEventFrame objects is not implemented in this release. This method will always perform a full load and will ignore the fullLoad parameter.

Examples

See the example Loading Element Hierarchy which illustrates using the LoadElementsToDepth(IListAFElement, Boolean, Int32, Int32) method to bulk load an entire hierarchy of elements into the client which is similar to how you would use this method to bulk load an entire hierarchy of event frames into the client.

Version Information

AFSDK


See Also

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