Class Notification
Represents a notification that is shown in a popup when the user clicks the notification icon in the title bar. The notification can contain UI items like an icon, texts and links.
Namespace: ABB.Robotics.RobotStudio.Environment
Assembly: ABB.Robotics.RobotStudio.Environment.dll
Syntax
public sealed class Notification
Remarks
Notifications are displayed in the order they are added, with the latest on top. A blue dot is shown on notifications that are new, i.e. have not been seen by the user. Also, a blue dot is shown on the icon in the title bar if there are any new notifications. Notifications can not be removed by the user, but expired notifications are automatically removed. Notifications can either be session-only or persisted between RobotStudio sessions. Notifications are immutable and cannot be modified after creation.
Constructors
Notification(String, NotificationIcon, NotificationPersistence, String, NotificationItem[])
Creates a new Notification.
Declaration
public Notification(string title, NotificationIcon icon, NotificationPersistence persistence, string tag, params NotificationItem[] items)
Parameters
Type | Name | Description |
---|---|---|
String | title | Title text for the notification. |
NotificationIcon | icon | Icon to show in the notification. |
NotificationPersistence | persistence | Defines how the notification will be persisted across RobotStudio sessions. |
String | tag | A user defined tag for the notification. Can be null. Prefix this with your add-in application id to ensure uniqueness. |
NotificationItem[] | items | Zero or more UI items to show in the notification. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if title is null, or if items or any of it's elements null. |
ArgumentException | Thrown if tag is an empty string. |
Notification(String, NotificationIcon, NotificationPersistence, String, TimeSpan, NotificationItem[])
Creates a new Notification.
Declaration
public Notification(string title, NotificationIcon icon, NotificationPersistence persistence, string tag, TimeSpan expiration, params NotificationItem[] items)
Parameters
Type | Name | Description |
---|---|---|
String | title | Title text for the notification. |
NotificationIcon | icon | Icon to show in the notification. |
NotificationPersistence | persistence | Defines how the notification will be persisted across RobotStudio sessions. |
String | tag | A user defined tag for the notification. Can be null. Prefix this with your add-in application id to ensure uniqueness. |
TimeSpan | expiration | Time after which the notification is automatically removed. This is only relevant for persisted notifications. |
NotificationItem[] | items | Zero or more UI items to show in the notification. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if title is null, or if items or any of it's elements null. |
ArgumentException | Thrown if tag is an empty string. |
Properties
DateAdded
Gets when the notification was added to Notifications.
Declaration
public DateTime DateAdded { get; }
Property Value
Type | Description |
---|---|
DateTime |
Expiration
Gets how long a persistent notification will be shown before it is automatically removed. The default is 90 days.
Declaration
public TimeSpan Expiration { get; }
Property Value
Type | Description |
---|---|
TimeSpan |
Icon
Gets the icon to show in the notification.
Declaration
public NotificationIcon Icon { get; }
Property Value
Type | Description |
---|---|
NotificationIcon |
IsNew
Gets if this notification is new, i.e. has not been seen by the user.
Declaration
public bool IsNew { get; }
Property Value
Type | Description |
---|---|
Boolean |
Items
Gets the UI items to show in the notification.
Declaration
public IReadOnlyList<NotificationItem> Items { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<NotificationItem> |
Persistence
Gets how the notification is persisted across RobotStudio sessions.
Declaration
public NotificationPersistence Persistence { get; }
Property Value
Type | Description |
---|---|
NotificationPersistence |
Tag
Gets a user defined tag for the notification.
Declaration
public string Tag { get; }
Property Value
Type | Description |
---|---|
String |
Remarks
There can only be one notification with the same tag. If a new notification with the same tag as an existing is added, the previous notification is removed.
Title
Gets the title text of the notification.
Declaration
public string Title { get; }
Property Value
Type | Description |
---|---|
String |
Methods
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |