/// <summary> /// Adds new elements to the end of an array, and returns the new length /// </summary> /// <param name="target">The target list to apply this method on.</param> /// <param name="elements">The elements to add</param> /// <returns>The new length</returns> public int Add(LObject target, params object[] elements) { if (elements == null || elements.Length == 0) { return(0); } // Add var list = target.GetValue() as IList; if (list == null) { return(0); } var table = target as LTable; var map = new LMap(new Dictionary <string, object>()); var ndx = 0; foreach (var field in table.Fields) { var val = elements[ndx]; map.Value[field] = val; ndx++; } list.Add(map); return(list.Count); }
public void addTranslation(String phrase, String lang, String translation) { LMap L = (LMap)holder.get(phrase); L.Add(lang, translation); holder.set(phrase, L); }
/// <summary> /// Evaluate /// </summary> /// <returns></returns> public override object DoEvaluate() { // Case 1: array type if (_arrayExpressions != null) { var items = new List <object>(); foreach (var exp in _arrayExpressions) { object result = exp == null ? null : exp.Evaluate(); items.Add(result); } var array = new LArray(items); return(array); } // Case 2: Map type var dictionary = new Dictionary <string, object>(); foreach (var pair in _mapExpressions) { var expression = pair.Item2; object result = expression == null ? null : expression.Evaluate(); dictionary[pair.Item1] = result; } var map = new LMap(dictionary); return(map); }
protected override async void OnAppearing() { base.OnAppearing(); var locator = CrossGeolocator.Current; var position = await locator.GetPositionAsync(); LMap.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(position.Latitude, position.Longitude), Distance.FromMiles(1))); }
// index here /// <summary> /// Evaluate /// </summary> /// <returns></returns> public object VisitMap(MapExpr expr) { var mapExprs = expr.Expressions; // Case 2: Map type var dictionary = new Dictionary <string, object>(); foreach (var pair in mapExprs) { var expression = pair.Item2; object result = expression == null ? null : expression.Evaluate(this); dictionary[pair.Item1] = result; } var map = new LMap(dictionary); return(map); }
private string FncGenerarDataGps() { string xresultado = string.Empty; try { if (this.PivotGrid.RowCount > -1) { ASPxGridView xgrid = new ASPxGridView(); xgrid.SettingsPager.Mode = GridViewPagerMode.ShowAllRecords; xgrid.DataSource = this.PivotGrid.CreateDrillDownDataSource(); xgrid.DataBind(); if (xgrid.VisibleRowCount > 0) { List <LMap> lmapas = new List <LMap>(); for (int i = 0; i < xgrid.VisibleRowCount; i++) { LMap lmapa = new LMap(); lmapa.UTM_Latitud = Convert.ToString(xgrid.GetRowValues(i, "GpsLatitud")); lmapa.UTM_Longitud = Convert.ToString(xgrid.GetRowValues(i, "GpsLongitud")); lmapa.Descripcion = "Cuenca:" + Convert.ToString(xgrid.GetRowValues(i, "Cuenca_DSC")) + "<br/>" + "Sub-Cuenca:" + Convert.ToString(xgrid.GetRowValues(i, "SubCuencaRio_DSC")) + "<br/>" + "Punto Monitoreo:" + Convert.ToString(xgrid.GetRowValues(i, "PuntoMonitoreo_DSC")) + "<br/>" + "Fecha:" + Convert.ToString(xgrid.GetRowValues(i, "FechaHoraInicial")) + "<br/>" + "Caudal:" + Convert.ToString(xgrid.GetRowValues(i, "Caudal")); lmapas.Add(lmapa); } if (lmapas.Count > 0) { xresultado = JsonConvert.SerializeObject(lmapas); } } } } catch (Exception ex) { xresultado = ex.Message; xresultado = string.Empty; } return(xresultado); }
public async void GetDonorProfile(string id) { ApiService apiService = new ApiService(); var donor = await apiService.GetDonor(id); var bloodType = await apiService.GetBloodType(id); var organType = await apiService.GetOrganType(id); ImgProfile.Source = donor.FullLogoPath; LblName.Text = donor.Name; LblLocation.Text = donor.Location; Lblblood.Text = bloodType.BloodType; LblRegion.Text = donor.Region; Lstvw.ItemsSource = organType; _email = donor.Email; _number = donor.Phone; LMap.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(donor.Latitude, donor.Longitude), Distance.FromMiles(1))); Overlay.IsVisible = false; }
private string FncGenerarDataGps() { string xresultado = string.Empty; try { if (ASPxGridView1.VisibleRowCount > -1) { if (ASPxGridView1.VisibleRowCount > 0) { List <LMap> lmapas = new List <LMap>(); for (int i = 0; i < ASPxGridView1.VisibleRowCount; i++) { LMap lmapa = new LMap(); lmapa.UTM_Latitud = Convert.ToString(ASPxGridView1.GetRowValues(i, "GpsLatitud")); lmapa.UTM_Longitud = Convert.ToString(ASPxGridView1.GetRowValues(i, "GpsLongitud")); lmapa.Descripcion = "Tipo Reporte:" + Convert.ToString(ASPxGridView1.GetRowValues(i, "TipoReporte_DSC")) + "<br/>" + "Departamento:" + Convert.ToString(ASPxGridView1.GetRowValues(i, "Departamento_DSC")) + "<br/>" + "Municipio:" + Convert.ToString(ASPxGridView1.GetRowValues(i, "Municipio_DSC")) + "<br/>" + "Fecha:" + Convert.ToString(ASPxGridView1.GetRowValues(i, "FechaHoraInicial")) + "<br/>" + "Comentarios:" + Convert.ToString(ASPxGridView1.GetRowValues(i, "Comentarios")); lmapas.Add(lmapa); } if (lmapas.Count > 0) { xresultado = JsonConvert.SerializeObject(lmapas); } } } } catch (Exception ex) { xresultado = ex.Message; xresultado = string.Empty; } return(xresultado); }
public String getTranslation(String phrase, String lang) { LMap L = (LMap)holder.get(phrase); return((String)L.get(lang)); }
public LanguageManager() { holder = new LMap(); ReadAllFiles(); }
/// <summary> /// Adds new elements to the end of an array, and returns the new length /// </summary> /// <param name="target">The target list to apply this method on.</param> /// <param name="elements">The elements to add</param> /// <returns>The new length</returns> public int Add(LObject target, params object[] elements) { if (elements == null || elements.Length == 0) return 0; // Add var list = target.GetValue() as IList; if (list == null) return 0; var table = target as LTable; var map = new LMap(new Dictionary<string, object>()); var ndx = 0; foreach(var field in table.Fields) { var val = elements[ndx]; map.Value[field] = val; ndx++; } list.Add(map); return list.Count; }