AFNotificationContent Class
- Last UpdatedNov 18, 2025
- 8 minute read
- PI System
- AF SDK 2024 R2
- Developer

Inheritance Hierarchy
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
| Name | Description | |
|---|---|---|
| Attribute |
This read-only property returns the AFAttribute for this content.
| |
| AttributeTemplate |
This read-only property returns the AFAttributeTemplate for this content.
| |
| ContentType |
Get or Set the type of content.
| |
| Database |
This read-only property returns the AFDatabase where this object is defined.
| |
| DisplayName |
Gets or sets the user-friendly display name for the content.
| |
| 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.) | |
| Identity |
This read-only property contains identity of the object.
(Inherited from AFObject.) | |
| IsDeleted |
This read-only property indicates whether the object has been deleted.
(Inherited from AFObject.) | |
| Name |
This property defines the name that identifies the object.
| |
| Notification |
This property returns the AFNotification object which owns the content.
| |
| NotificationContacts |
The list of contacts that are subscribed to this notification content.
| |
| NotificationTemplate |
This property returns the AFNotificationTemplate object which owns the content.
| |
| PISystem |
This read-only property allows access to the PISystem associated with this
object.
(Inherited from AFObject.) | |
| TemplateContent |
This read-only property returns the AFNotificationContent from the
AFNotificationTemplate that was used to create this content.
| |
| UniqueID |
Read-only property that provides the object's ID as a String.
(Inherited from AFObject.) |
Methods
| Name | Description | |
|---|---|---|
| CompareTo(Object) |
Compares this instance with a specified Object.
(Inherited from AFObject.) | |
| CompareTo(AFObject) |
Compares this instance with a specified AFObject.
(Inherited from AFObject.) | |
| Equals(Object) |
Determines whether the specified Object is equal to the current object.
(Inherited from AFObject.) | |
| Equals(AFObject) |
Indicates whether the current object is equal to another object of the same type.
(Inherited from AFObject.) | |
| 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.) | |
| GetPath |
Returns the full path to the object, using just the names.
(Inherited from AFObject.) | |
| GetPath(AFObject) |
Returns the path to the object relative from another object.
(Inherited from AFObject.) | |
| 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.) | |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| IsTraced |
Indicates if a specified level is being traced.
| |
| Persist |
This method returns the persistence string for the object.
(Inherited from AFObject.) | |
| ToString |
Returns a String that represents the current object.
(Inherited from AFObject.) | |
| TraceData |
Output a data trace event.
| |
| TraceDetail |
Output a detail trace event.
| |
| TraceError |
Output an error trace event.
| |
| TraceEvent(AFTraceSwitchLevel, String) |
Output a trace event with a message.
| |
| TraceEvent(AFTraceSwitchLevel, String, Int32) |
Output a trace event with a message and a duration.
| |
| TraceEvent(AFTraceSwitchLevel, String, Object) |
Output a trace event as a formatted message with a variable number of arguments.
| |
| TraceInformation |
Output an information trace event.
| |
| TraceSummary |
Output a summary trace event.
| |
| 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.