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

AF SDK Reference

IPIPersist Interface

  • Last UpdatedNov 18, 2025
  • 3 minute read
IPIPersist Interface
The IPIPersist interface allows a persistence string for an object to be obtained.

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

Syntax

[ComImportAttribute]
[EditorBrowsableAttribute(EditorBrowsableState.Never)]
[GuidAttribute("BA451DA1-EA7F-11D3-BDC5-00C04F779EB2")]
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IPIPersist
<ComImportAttribute>
<EditorBrowsableAttribute(EditorBrowsableState.Never)>
<GuidAttribute("BA451DA1-EA7F-11D3-BDC5-00C04F779EB2")>
<InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)>
Public Interface IPIPersist

Dim instance As IPIPersist
[ComImportAttribute]
[EditorBrowsableAttribute(EditorBrowsableState::Never)]
[GuidAttribute(L"BA451DA1-EA7F-11D3-BDC5-00C04F779EB2")]
[InterfaceTypeAttribute(ComInterfaceType::InterfaceIsIUnknown)]
public interface class IPIPersist
[<ComImportAttribute>]
[<EditorBrowsableAttribute(EditorBrowsableState.Never)>]
[<GuidAttribute("BA451DA1-EA7F-11D3-BDC5-00C04F779EB2")>]
[<InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)>]
type IPIPersist =  interface end

The IPIPersist type exposes the following members.

Methods

  NameDescription
Public method
Persist
This method returns the persistence string for the object.

Remarks

Note Note
This interface duplicates the interface defined in the PI SDK. We do this to avoid needing a reference to PISDKCommon for every user of the AF SDK. The GUID must match the one defined by the PI SDK.

This interface has one method, Persist, which allows the caller to obtain a persistence string that can be used to restore the same object later.

For example, a program may want to save a PIPoint, AFBaseElement, AFAttribute, etc. in a file and retrieve that object the next time the program runs. You may persist a number of collections also: AFAttributes, PIPointList, etc.

To retrieve the object, create a AFGlobalRestorer object and pass it the persistence string.

IPIPersist is a generic interface that any developer can implement. With that and a corresponding restorer object that supports the IPIRestorer interface, objects can be persisted and restored.

Objects that support the IPIPersist interface can be saved as the Value property of a PIProperty or AFAttribute object. When the PIProperty or AFAttribute is saved, the persistence string for the object is saved. When the Value property is retrieved later, the object will be restored and returned in the value.

Version Information

AFSDK


See Also

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