Extensions

Top  Previous  Next

The FinalBuilder Server Notification Application allows you to extend the notifications by allowing you to create your own notification extensions in managed code.

 

Creating an extension

 

1. Create a new class that implements IProjectNotificationExtension and is optionally decorated with ExtensionDescriptionAttribute. These classes can be found in the FinalBuilderServer.Notification.Extension.dll assembly located in the notification application's program files directory.

2. Compile the assembly and place it in the 'Extensions' directory located in the Notification Applications program files directory.

3. Restart the Notification Application.

4. On the 'Notifications' tab of the options dialog your new extension will be listed in the external extensions list, enable it by checking the checkbox.

 

 

C# Example

 

   [ExtensionDescription("Example External Project Notification", "An example notification extension")]

   public class ExtensionExample : IProjectNotificationExtension

   {

 

       public void OnProjectSucceeded(string serverURL, string projectName)

       {

           MessageBox.Show(

               string.Format("{0} on {1} has completed successfully.", projectName, serverURL),

               "Example Notification - Project Successful",

               MessageBoxButtons.OK,

               MessageBoxIcon.Information);

       }

 

       public void OnProjectFailed(string serverURL, string projectName)

       {

           MessageBox.Show(

               string.Format("{0} on {1} has failed to complete successfully.", projectName, serverURL),

               "Example Notification - Project Failure",

               MessageBoxButtons.OK,

               MessageBoxIcon.Information);

       }

 

   }

 

 

VB Example

 

<ExtensionDescription("Example External Project Notification", "An example notification extension")> _

Public Class VBSampleExtension

   Implements IProjectNotificationExtension

 

   Public Sub OnProjectSucceeded(ByVal serverURL As String, ByVal projectName As String) Implements IProjectNotificationExtension.OnProjectSucceeded

       MessageBox.Show(String.Format("{0} on {1} has completed successfully.", projectName, serverURL), "Example Notification - Project Successful", MessageBoxButtons.OK, MessageBoxIcon.Information)

   End Sub

 

   Public Sub OnProjectFailed(ByVal serverURL As String, ByVal projectName As String) Implements IProjectNotificationExtension.OnProjectFailed

       MessageBox.Show(String.Format("{0} on {1} has failed to complete successfully.", projectName, serverURL), "Example Notification - Project Failure", MessageBoxButtons.OK, MessageBoxIcon.Information)

   End Sub

 

End Class