Add your plugin to Pointsharp ID

You have to import the plugin to each Pointsharp ID environment that should be using the plugin.

To import the plugin, follow these steps:

  1. Place the DLL files of your plugin class library and its dependencies (PSIDAPI.dll is not required, it exists already) in the plugin folder: C:/Program Files/PointSharp/Pointsharp ID/bin/plugins.

  2. Start the Pointsharp ID Admin GUI (if already started; then close and restart).

  3. Verify the import: Go to Tools > Pointsharp SDK. You should see your plugin in the list, if not; look in the log file of the Pointsharp ID Admin GUI to see if any issue occurred during import.

  4. Test your plugin by configuring Pointsharp ID to use it.

Notification example

Here is an example implementation of the INotificationPlugin interface to demonstrate of how to create a custom notification method that prints the message to a file instead of sending it with email or other.

Test Notification Plugin (Click to show)
using Psid.API.Notification;
using System.IO;

namespace Pointsharp.Api.Examples
{
    /// <summary>
    /// An example implementation of the Psid.API.Notification.INotificationPlugin
    /// </summary>
    public class TestNotification : INotificationPlugin
    {
        private string _notificationFolder;

        public TestNotification()
        {
            // The folder to write the messages into
            this._notificationFolder = @"C:\Program Files\Pointsharp\Pointsharp ID\notifications";
        }

        public string Description
        {
            get { return "My Test Notification"; }
        }

        public string Name
        {
            get { return "TestNotification"; }
        }

        public bool Notify(string text, string recipient)
        {
            var isNotified = false;

            try
            {
                // TODO: Handle more than one message to the same recipient

                // The full path to the file to write the message to
                var notificationTextFile = Path.Combine(
                    this._notificationFolder,
                    recipient + ".txt"
                    );

                // Write to file
                File.WriteAllText(notificationTextFile, text);
                isNotified = true;
            }
            catch
            {
                // TODO: Write exception to log...
            }

            return isNotified;
        }
    }
}
Add a folder called notification in the Pointsharp ID folder, since we — in the example code — hard-coded that it should write all its messages to this folder.

Test Notification example

To test our notification example, we have to copy it to the plugin folder.

Then do the following:

  1. In Pointsharp ID Admin GUI, go to Notification and select Add.

  2. Mark our notification (it will be prefixed with Pointsharp SDK).

  3. Set the name to MyNotification.

  4. Click OK.

  5. Mark MyNotification in the list of notifications, and select Test.

  6. Enter a destination address in the recipient field, and a message in the message box.

  7. Click send.

  8. Look in our notification folder created earlier, and verify that the file was created and that the message was written.