public static List <int> DetectWrongWaypoints(string inPath) //inPath = name of itinerary (i.e. "default")
        {
            SStopOffPoint[] wp;
            List <int>      ids = new List <int>();

            CApplicationAPI.GetItineraryList(out _mySError, inPath, out wp, 0);

            if (wp != null)
            {
                for (int i = 0; i < wp.Length - 1; i++)
                {
                    SStopOffPoint[] tmpWp = new SStopOffPoint[2];
                    tmpWp[0]            = wp[i];
                    tmpWp[0].nPointType = 3;

                    tmpWp[1]            = wp[i + 1];
                    tmpWp[1].nPointType = 2;

                    CApplicationAPI.AddItinerary(out _mySError, tmpWp, inPath + "-" + i.ToString(), 0);
                    int result = CApplicationAPI.SetRoute(out _mySError, inPath + "-" + i.ToString(), 0, true, 0);
                    if (result != 1)
                    {
                        ids.Add(i + 1);
                    }
                }
            }
            return(ids);
        }
 public static void GetItineraryList(string inStrItineraryName, int inMaxTime)
 {
     SStopOffPoint[] points;
     CApplicationAPI.GetItineraryList(out _mySError, inStrItineraryName, out points, inMaxTime);
     if (points != null)
     {
         for (int i = 0; i < points.Length; i++)
         {
             O(" " + i.ToString()
               + ". point type:" + points[i].nPointType
               + ", visited:" + points[i].bVisited
               + ", x=" + points[i].Location.lX
               + ", y=" + points[i].Location.lY
               + ", caption:" + points[i].GetCaption()
               + ", Address:" + points[i].GetAddress()
               );
         }
     }
 }
        public static void DevideItinerary(string inPath)
        {
            SStopOffPoint[] wp;
            CApplicationAPI.GetItineraryList(out _mySError, inPath, out wp, 0);

            if (wp != null)
            {
                for (int i = 0; i < wp.Length - 1; i++)
                {
                    SStopOffPoint[] tmpWp = new SStopOffPoint[2];
                    tmpWp[0]            = wp[i];
                    tmpWp[0].nPointType = 3;

                    tmpWp[1]            = wp[i + 1];
                    tmpWp[1].nPointType = 2;
                    O("Itinerary name: " + inPath + i.ToString() + ", " + tmpWp[1].GetAddress());
                    DriveHandler.AddItinerary(inPath + i.ToString(), tmpWp);
                }
            }
        }