//AddPoi with LocationFromAddress public static void AddPoi(string inStrAddress, bool inBPostal, bool inBValueMatch, string inCategory, string inName, bool inSearch_address, int inMaxTime) { LONGPOSITION lp; int ret = CApplicationAPI.LocationFromAddress(out _mySError, out lp, inStrAddress, inBPostal, inBValueMatch, inMaxTime); O("LocationFromAddress returns: " + ret.ToString()); SPoi p = new SPoi(lp, inCategory, inName, inSearch_address ? 1 : 0); ret = CApplicationAPI.AddPoi(out _mySError, ref p, inMaxTime); O("AddPoi returns: " + ret.ToString()); }
public static void AddPoi(int inX, int inY, string inCategory, string inName, bool inSearch_address, int inMaxTime) { LONGPOSITION lp; lp.lX = inX; lp.lY = inY; SPoi p = new SPoi(lp, inCategory, inName, inSearch_address ? 1 : 0); int ret = CApplicationAPI.AddPoi(out _mySError, ref p, inMaxTime); O("AddPoi returns: " + ret.ToString()); }
public static void FindNearbyPoi(int inListSize, int inCategoryNumber, string inStrCategoryName, int inLX, int inLY, int inMaxTime) { SPoi[] pois = new SPoi[0]; int ret = CApplicationAPI.FindNearbyPoi(out _mySError, out pois, ref inListSize, inCategoryNumber, inStrCategoryName, inLX, inLY, inMaxTime); O("FindNearbyPoi returns: " + ret.ToString()); if (pois != null) { for (int i = 0; i < pois.Length; i++) { O(" " + i.ToString() + ". " + pois[i].GetName() + ", " + pois[i].GetAddress()); } } }
//CANDIDO //public BatteryLevel batteryId = Microsoft.WindowsMobile.Status.SystemState.PowerBatteryStrength; public void anadePoi(string nombre, string tipo,int CoorX, int CoorY, int time) { //IMAGEN EN SYGIC SError err; try { int res = CApplicationAPI.DeletePoiCategory(out err, nombre, "ESP", 1000);//(Borramos Para las pruebas) string dirImagen = @nombre + ".bmp"; res = CApplicationAPI.AddPoiCategory(out err, nombre, dirImagen, "ESP", 1000); LONGPOSITION position = new LONGPOSITION(CoorX, CoorY);//X, Y); SPoi poi = new SPoi(position,nombre, tipo, 0); res = CApplicationAPI.AddPoi(out err, ref poi, time); } catch { } //SONIDO //Sound sound = new Sound(Assembly.GetExecutingAssembly().GetManifestResourceStream("SoundSample."+tipo+".wav")); //sound.Play(); //OpenFileDialog dialog1 = new OpenFileDialog(); //dialog1.ShowDialog() // Properties.Resources. string _appFolder = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase); string dirSonido = _appFolder + @"\Sounds\" + tipo + ".wav"; dirSonido = "\\Tarjeta de almacenamiento\\FLEET_MOBILE_14d\\MisSonidos\\" + tipo + ".wav";//parking.wav"; try { //PlaySound((LPCWSTR)dirSonido, 0, SND_LOOP | SND_ASYNC | SND_FILENAME); WSounds ws = new WSounds(); ws.Play(dirSonido, ws.SND_FILENAME | ws.SND_ASYNC); /* DriveHandler.SendDriveToForeground(1); System.Threading.Thread.Sleep(5000); DriveHandler.SendDriveToBackground(1);*/ } catch //()Exception ex) { //Invoke(myDelegate, new Object[] { "Error: " + ex.Message }); } }
private void añadePoi(int X, int Y) { string dirimconges = "\\Tarjeta de almacenamiento\\FLEET_MOBILE_14d\\Res\\icons\\poi\\1_favo_3.bmp"; SError err; SPoi poi; LONGPOSITION position = new LONGPOSITION(X, Y); int res = CApplicationAPI.AddPoiCategory(out err, "Restaurante", dirimconges, "ESP", 0); Formulario.Invoke(Formulario.myDelegate, new Object[] { "El resultado de añadir una categoría es: " + err.GetDescription() }); //res = CApplicationAPI.LocationFromAddress(out err, out position, "SVK,Bratislava,Zochova,1", false, false, 0); poi = new SPoi(position, "Restaurante", "New POI", 0); res = CApplicationAPI.AddPoi(out err, ref poi, 0); Formulario.Invoke(Formulario.myDelegate, new Object[] { "El resultado de añadir el POI es: " + err.GetDescription() }); int b = res; // CApplicationAPI.AddPoiCategory(out error, strCategory, strBitmapPath, strISOCode, nMaxTime); //int a= CApplicationAPI.AddPoi(out Error, ref Poi ,MaxTime); //Formulario.Invoke(Formulario.myDelegate, new Object[] {"El resultado de añadePOI es "+a+ " "+Error.nCode}); }