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

AF SDK Reference

AFNotificationContent Class

  • Last UpdatedNov 18, 2025
  • 8 minute read
AFNotificationContent Class
The AFNotificationContent defines content associated with a notification.

Inheritance Hierarchy

SystemObject
  OSIsoft.AFAFObject
    OSIsoft.AF.NotificationAFNotificationContent

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

Syntax

[SerializableAttribute]
public sealed class AFNotificationContent : AFObject, 
	IComparable<AFNotificationContent>, IAFTrace
<SerializableAttribute>
Public NotInheritable Class AFNotificationContent
	Inherits AFObject
	Implements IComparable(Of AFNotificationContent), IAFTrace

Dim instance As AFNotificationContent
[SerializableAttribute]
public ref class AFNotificationContent sealed : public AFObject, 
	IComparable<AFNotificationContent^>, IAFTrace
[<SealedAttribute>]
[<SerializableAttribute>]
type AFNotificationContent =  
    class
        inherit AFObject
        interface IComparable<AFNotificationContent>
        interface IAFTrace
    end

The AFNotificationContent type exposes the following members.

Properties

  NameDescription
Public property
Attribute
This read-only property returns the AFAttribute for this content.
Public property
AttributeTemplate
This read-only property returns the AFAttributeTemplate for this content.
Public property
ContentType
Get or Set the type of content.
Public property
Database
This read-only property returns the AFDatabase where this object is defined.
Public property
DisplayName
Gets or sets the user-friendly display name for the content.
Public property
ID
Read-only property that provides a unique identifier for the object to be used for quick access that is not dependent upon the index.
(Inherited from AFObject.)
Public property
Identity
This read-only property contains identity of the object.
(Inherited from AFObject.)
Public property
IsDeleted
This read-only property indicates whether the object has been deleted.
(Inherited from AFObject.)
Public property
Name
This property defines the name that identifies the object.
Public property
Notification
This property returns the AFNotification object which owns the content.
Public property
NotificationContacts
The list of contacts that are subscribed to this notification content.
Public property
NotificationTemplate
This property returns the AFNotificationTemplate object which owns the content.
Public property
PISystem
This read-only property allows access to the PISystem associated with this object.
(Inherited from AFObject.)
Public property
TemplateContent
This read-only property returns the AFNotificationContent from the AFNotificationTemplate that was used to create this content.
Public property
UniqueID
Read-only property that provides the object's ID as a String.
(Inherited from AFObject.)

Methods

  NameDescription
Public method
CompareTo(Object)
Compares this instance with a specified Object.
(Inherited from AFObject.)
Public method
CompareTo(AFObject)
Compares this instance with a specified AFObject.
(Inherited from AFObject.)
Public method
Equals(Object)
Determines whether the specified Object is equal to the current object.
(Inherited from AFObject.)
Public method
Equals(AFObject)
Indicates whether the current object is equal to another object of the same type.
(Inherited from AFObject.)
Public method
GetHashCode
Gets the hash code for this instance of the object which is suitable for use in hashing algorithms and data structures like a hash table.
(Inherited from AFObject.)
Public method
GetPath
Returns the full path to the object, using just the names.
(Inherited from AFObject.)
Public method
GetPath(AFObject)
Returns the path to the object relative from another object.
(Inherited from AFObject.)
Public method
GetPath(AFEncodeType, AFObject)
Returns the path to the object relative from another object, using the name and/or id as specified by encodeType.
(Inherited from AFObject.)
Public method
GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method
IsTraced
Indicates if a specified level is being traced.
Public method
Persist
This method returns the persistence string for the object.
(Inherited from AFObject.)
Public method
ToString
Returns a String that represents the current object.
(Inherited from AFObject.)
Public method
TraceData
Output a data trace event.
Public method
TraceDetail
Output a detail trace event.
Public method
TraceError
Output an error trace event.
Public method
TraceEvent(AFTraceSwitchLevel, String)
Output a trace event with a message.
Public method
TraceEvent(AFTraceSwitchLevel, String, Int32)
Output a trace event with a message and a duration.
Public method
TraceEvent(AFTraceSwitchLevel, String, Object)
Output a trace event as a formatted message with a variable number of arguments.
Public method
TraceInformation
Output an information trace event.
Public method
TraceSummary
Output a summary trace event.
Public method
TraceWarning
Output a warning trace event.

Remarks

The notification content defines the content associated with a notification. If an AFNotification is created from an AFNotificationTemplate, then the notification's content can be defined by notification template's Contents collection.

A notification content is always associated with either an AFAttributeTemplate (when owned by an AFNotificationTemplate) or an AFAttribute (when owned by an AFNotification). The associated attribute template or attribute provides the value information for the content.

Examples

// This example demonstrates how to create a notification template that
// defines some notification contacts and notification contents. It then
// creates a notification from the template and displays its information.

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

// Create a Notification Template
AFNotificationTemplate myNotificationTemplate = new AFNotificationTemplate("MyNotificationTemplate");
myDB.ElementTemplates.Add(myNotificationTemplate);
AFNotificationContact myTmplContact1 = myNotificationTemplate.NotificationContacts.Add("MyContact#1");
AFNotificationContact myTmplContact2 = myNotificationTemplate.NotificationContacts.Add("MyContact#2");
AFNotificationContent myTmplContent1 = myNotificationTemplate.Contents.Add("MyContent#1");
myTmplContent1.NotificationContacts.Add(myTmplContact1);

// Create a Notification from the Notification Template
// and Add Additional Contacts and Content
AFNotification myNotification = new AFNotification(myDB, "MyNotification", myNotificationTemplate, null);
AFNotificationContact myContact1 = myNotification.NotificationContacts["MyContact#1"];
AFNotificationContact myContact2 = myNotification.NotificationContacts["MyContact#2"];
AFNotificationContact myContact3 = myNotification.NotificationContacts.Add("MyContact#3");
AFNotificationContent myContent1 = myNotification.Contents["MyContent#1"];
AFNotificationContent myContent2 = myNotification.Contents.Add("MyContent#2");
myContent1.NotificationContacts.Add(myContact3);
myContent2.NotificationContacts.Add(myContact2);
myContent2.NotificationContacts.Add(myContact3);

// Display Information for the Notification Contents
foreach (AFNotificationContent item in myNotification.Contents)
{
    Console.WriteLine("Name of Notification Content = {0}", item.Name);
    if (item.Attribute != null)
        Console.WriteLine("    Content's Attribute = {0}", item.Attribute.Name);
}
' This example demonstrates how to create a notification template that
' defines some notification contacts and notification contents. It then
' creates a notification from the template and displays its information.

' Get the Database
Dim myPISystems As PISystems = New PISystems
Dim myDB As AFDatabase = myPISystems.DefaultPISystem.Databases.DefaultDatabase

' Create a Notification Template
Dim myNotificationTemplate As AFNotificationTemplate = New AFNotificationTemplate("MyNotificationTemplate")
myDB.ElementTemplates.Add(myNotificationTemplate)
Dim myTmplContact1 As AFNotificationContact = myNotificationTemplate.NotificationContacts.Add("MyContact#1")
Dim myTmplContact2 As AFNotificationContact = myNotificationTemplate.NotificationContacts.Add("MyContact#2")
Dim myTmplContent1 As AFNotificationContent = myNotificationTemplate.Contents.Add("MyContent#1")
myTmplContent1.NotificationContacts.Add(myTmplContact1)

' Create a Notification from the Notification Template
' and Add Additional Contacts and Content
Dim myNotification As AFNotification = New AFNotification(myDB, "MyNotification", myNotificationTemplate, Nothing)
Dim myContact1 As AFNotificationContact = myNotification.NotificationContacts("MyContact#1")
Dim myContact2 As AFNotificationContact = myNotification.NotificationContacts("MyContact#2")
Dim myContact3 As AFNotificationContact = myNotification.NotificationContacts.Add("MyContact#3")
Dim myContent1 As AFNotificationContent = myNotification.Contents("MyContent#1")
Dim myContent2 As AFNotificationContent = myNotification.Contents.Add("MyContent#2")
myContent1.NotificationContacts.Add(myContact3)
myContent2.NotificationContacts.Add(myContact2)
myContent2.NotificationContacts.Add(myContact3)

' Display Information for the Notification Contents
For Each item As AFNotificationContent In myNotification.Contents
    Console.WriteLine("Name of Notification Content = {0}", item.Name)
    If item.Attribute <> Nothing Then
        Console.WriteLine("    Content's Attribute = {0}", item.Attribute.Name)
    End If
Next

No code example is currently available or this language may not be supported.

No code example is currently available or this language may not be supported.

Version Information

AFSDK


See Also

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