AFNotificationRuleTemplates.Add Method (String, Boolean)
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
The Add method creates a new object and adds it to the collection.
Namespace: OSIsoft.AF.Notification
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public AFNotificationRuleTemplate Add( string name, bool createEnabled = false )
Public Function Add ( name As String, Optional createEnabled As Boolean = false ) As AFNotificationRuleTemplate Dim instance As AFNotificationRuleTemplates Dim name As String Dim createEnabled As Boolean Dim returnValue As AFNotificationRuleTemplate returnValue = instance.Add(name, createEnabled)
public: AFNotificationRuleTemplate^ Add( String^ name, bool createEnabled = false )
member Add : name : string * ?createEnabled : bool (* Defaults: let _createEnabled = defaultArg createEnabled false *) -> AFNotificationRuleTemplate
Parameters
- name
- Type: SystemString
The name for the new object, which must be unique within the collection. If the name ends with an asterisk (*), then a unique name will be generated based on the supplied name. See the ValidateName(String, String) method for a description of what is valid when setting the name of the object. - createEnabled (Optional)
- Type: SystemBoolean
Specifies whether new auto created AFNotificationRule objects created from this template are created with the Status property set to Enabled or Disabled.
Return Value
Type: AFNotificationRuleTemplateReturns the newly created object that was added to the collection.
Remarks
The new object will be created with the specified name. All other
properties of the object will be set to their default value.