Follow

Notification destination reached example

Introduction

This sample demonstrates how to catch the event "destination reached" from navigation.
They key point here is to catch the flow within the API callback, here represented by the function NaviHandler.

C#

public static void NaviHandler(int nEventID, IntPtr strData)
{
    // cast the event to ApplicationEvents enumeration
    ApplicationEvents anAppEvent = (ApplicationEvents)nEventID;

    // handle event
    switch (anAppEvent)
    {
      case ApplicationEvents.EVENT_ROUTE_FINISH:
         Debug.WriteLine("Destination reached.");
         break;
    }
}

public static int StartSygic()
{
    string mySygicPath = ...
    IntPtr inParentWnd = ...
    CApplicationAPI.ApplicationHandler AppHnd = new CApplicationAPI.ApplicationHandler(NaviHandler);
    int ret = CApplicationAPI.InitApi(mySygicPath, AppHnd, 0, 0, 320, 240, true, false, inParentWnd);
    return ret;
}
    

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments