Show/Hide Toolbars

Therefore Programming Interface 3.0

 

Requirements and Assumptions:

bullet AddIn project configured and registered as described in "AddIn Creation in C#" or "Add In Creation in VB .NET".

Visual Basic

Imports System.Runtime.InteropServices

Imports System.IO

Imports System.Windows.Forms

Imports Therefore.API

 

<Guid("5E2732E4-7350-4b0a-BB8B-C89623F1C5BB"), ComVisible(True), ClassInterface(ClassInterfaceType.None)> _

Public Class QueryAddIn

    Implements ITheAddIn

 

    Public Sub GetHandledEvents(ByVal client As TheClientType, ByVal eventSet As TheEventSet) Implements ITheAddIn.GetHandledEvents

        If (client = TheClientType.NavigatorClient) Then

            eventSet.Add(TheEventType.QueryFinished)

        End If

    End Sub

 

    Public Function HandleEvent(ByVal e As TheEvent) As Integer Implements ITheAddIn.HandleEvent

        ' When a query finishes display a message box with query definition and results

        If (e.EventType = TheEventType.QueryFinished) Then

            MessageBox.Show(e.MultiQuery.ToString & vbNewLine & e.MultiQueryResult.ToString)

        End If

        Return 0

    End Function

 

End Class

C#

using System;

using System.Collections.Generic;

using System.IO;

using System.Runtime.InteropServices;

using System.Text;

using System.Windows.Forms;

using Therefore.API;

 

namespace AddInSamples

{

    [Guid("9D4ABDD8-5890-4e17-B8CF-DEED2B83D710"), ComVisible(true), ClassInterface(ClassInterfaceType.None)]

    public class QueryAddIn : ITheAddIn

    {

        public void GetHandledEvents(TheClientType client, TheEventSet eventSet)

        {

            if (client == TheClientType.NavigatorClient)

                eventSet.Add(TheEventType.QueryFinished);

        }

 

        public int HandleEvent(TheEvent e)

        {

            // When a query finishes display a message box with query definition and results

            if (e.EventType == TheEventType.QueryFinished)

            {

                MessageBox.Show(e.MultiQuery.ToString() + "\r\n" + e.MultiQueryResult.ToString());

            }

 

            return 0;

        }

    }

}

 

© 2022 Therefore Corporation, all rights reserved.