Notification
A Notification instance can be used to inform the user about various events. For a Notification instance to be displayed in Rhino, it must be added to the NotificationCenter. When added, it will be displayed in the Notifications panel in Rhino. A Notification contains 1 to 3 buttons that are automatically wired to its
ButtonClicked
Action if it is not null. The buttons are displayed when the Notification is shown modally by either the user clicking on a particular notification in the Notifications panel, or by programatically showing it using ShowModal.. Currently, only process-wide notifications are supported; document specific notifications are not possible. Notification instances contain metadata that can be added, modified, or removed during its life. The metadata is important for LINQ queries and other patterns. For example, a particular action may require that multiple notifications be modified. Thus, a LINQ query can be performed on the NotificationCenter using metadata to retrieve related Notification objects and modify them as a batch. Notification objects implement IAssemblyRestrictedObject. By default, a Notification can be editedby any assembly, but explicitly specifing allowed assemblies in the constructor changes this behavior. Notification objects are not thread-safe and should only be manipulated in UI thread.Inheritance Hierarchy
System.Object
Rhino.Runtime.Notifications.Notification
Namespace: Rhino.Runtime.Notifications
Assembly: RhinoCommon (in RhinoCommon.dll)
Syntax
public class Notification : INotifyPropertyChanged, IAssemblyRestrictedObject
The Notification type exposes the following members.
Constructors
Name
Description
Public Method
Notification.
Creates a new instance that can be edited by any assembly.
Public Method
Notification(IEnumerable.Assembly.)
Creates a new instance that can be edited by the given assemblies.
Properties
Name
Description
Public Property
AllowedAssemblies
The assemblies that can modify this instance.
Public Property
AlternateButtonTitle
The localized title of the Alternate button.
Public Property
ButtonClicked
An Action that will be invoked whenever a button for the notification is clicked or the notification is closed.
Public Property
CancelButtonTitle
The localized title of the Cancel button.
Public Property
ConfirmButtonTitle
The localized title of the Confirm button.
Public Property
DateUpdated
The date the notification was last modified.
Public Property
Description
The description of the notification. The description is displayed in the Notifications panel in Rhino.
Public Property
Item
Gets or sets metadata for this instance.
Public Property
Message
The message of the notification. The message is shown only when the instance is displayed modally. It should contain details about the notification.
Public Property
MetadataCopy
A copy of all the metadata for this class.
Public Property
SeverityLevel
The severity of the notification. Changing the severity of the notification may change the way Rhino chooses to display the Notifications panel.
Public Property
ShowEventId
A field used by Rhino for displaying notifications. Not intended for public use.
Public Property
Title
The title of the notification. The title is displayed when the notification is displayed modally in Rhino.
Methods
Name
Description
Public Method
Editable
Determines whether an assembly can modify the instance. Any code that modifies an assembly protected notification must be wrapped in a ExecuteAssemblyProtectedCode(Action) method.
Public Method
Equals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public Method
Static Member
ExecuteAssemblyProtectedCode(Action)
If a Notification object is only allowed to be modified by certain assemblies, then any code that interacts with it must be wrapped around this method, or a InvalidOperationException will be thrown. For performance reasons, the code wrapped by this method should be kept as simple as possible.
Public Method
Static Member
ExecuteAssemblyProtectedCode.TResult.(Func.TResult.)
If a Notification object is only allowed to be modified by certain assemblies, then any code that interacts with it must be wrapped around this method, or a InvalidOperationException will be thrown. For performance reasons, the code wrapped by this method should be kept as simple as possible.
Protected Method
Finalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public Method
GetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public Method
GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public Method
HideModal
Tells Rhino to hide the notification if it is being currently shown as a modal.
Protected Method
MemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public Method
RemoveMetadata
Removes metadata from this instance.
Public Method
ShowModal
Tells Rhino to display the notification modally.
Public Method
ToString
Returns a readable string representation of the instance.
(Overrides Object.ToString..)
Events
Name
Description
Public Event
PropertyChanged
Triggered whenever a visible property of the instance changes.