Click or drag to resize
OSIsoft, LLC

AFEventFrameDeleteEventFrames Method

Delete the objects with the specified unique identifiers.

Namespace:  OSIsoft.AF.EventFrame
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version:
public static void DeleteEventFrames(
	PISystem system,
	IList<Guid> ids


Type: OSIsoft.AFPISystem
The PISystem containing the objects to be deleted.
Type: System.Collections.GenericIListGuid
A list of the unique identifiers of the objects to be checked out.

This method will delete the objects in the specified list of ids with out requiring a checkout of the object. If the object is already checked out by another user the specified object will still be deleted.

This method will delete all references, including sandbox, to any object specified in the list of ids where the user has Delete permission on the object.

// This example demonstrates how to use efficiently delete event frames using
//  AFEventFrameSearch and the DeleteEventFrames method.

// Get the Database
PISystems myPISystems = new PISystems();
PISystem myPISystem = myPISystems.DefaultPISystem;
AFDatabase myDB = myPISystem.Databases.DefaultDatabase;

// Search for the event frames to be deleted.
using (var search = new AFEventFrameSearch(myDB, "FindEventFrames", @"Template:'MyTemplate'"))
    search.CacheTimeout = TimeSpan.FromMinutes(10);

    // Get a list of IDs of event frames to be deleted in pages of 100.
    foreach (IList<Guid> pageOfIds in search.FindObjectIds().ChunkedBy(100))
        AFEventFrame.DeleteEventFrames(myPISystem, pageOfIds);
Version Information


Supported in: 2.10.5, 2.10
See Also
Enabling Operational Intelligence