Ejemplo n.º 1
0
        private string GetInfoWindowText(MapViewInfo mapViewInfo)
        {
            string html = mapViewInfo.InfoWindowText;

            if (string.IsNullOrEmpty(html))
            {
                return(string.Empty);
            }


            if (!AllowHtmlInInfoText)
            {
                const string lineBreak = "<br/>";
                html = System.Web.HttpUtility.HtmlEncode(mapViewInfo.InfoWindowText)
                       .Replace("\r\n", lineBreak)
                       .Replace("\n\r", lineBreak)
                       .Replace("\n", lineBreak)
                       .Replace("\r", lineBreak);
            }
            return(html.Replace("'", "''"));
        }
Ejemplo n.º 2
0
        void MapControlOnMapViewInfoNeeded(object sender, MapViewInfoEventArgs mapViewInfoEventArgs)
        {
            var mapView      = ModelMapView;
            var mapViewInfos = new List <MapViewInfo>();

            foreach (var obj in ((IList)MapControl.DataSource))
            {
                var    mapViewInfo = new MapViewInfo();
                string address     = GetMemberValueToString(obj, mapView.AddressMember);
                if (!string.IsNullOrEmpty(address))
                {
                    mapViewInfo.Address = address;
                }

                mapViewInfo.InfoWindowText = GetMemberValueToString(obj, mapView.InfoWindowTextMember);

                mapViewInfo.Latitude  = GetMemberValue <decimal?>(obj, mapView.LatitudeMember);
                mapViewInfo.Longitude = GetMemberValue <decimal?>(obj, mapView.LongitudeMember);
                mapViewInfos.Add(mapViewInfo);
            }
            mapViewInfoEventArgs.MapViewInfos = mapViewInfos;
        }
Ejemplo n.º 3
0
        private string GetInfoWindowText(MapViewInfo mapViewInfo)
        {
            string html = mapViewInfo.InfoWindowText;
            if (string.IsNullOrEmpty(html)) return string.Empty;

            
            if (!AllowHtmlInInfoText) {
                const string lineBreak = "<br/>";
                html = System.Web.HttpUtility.HtmlEncode(mapViewInfo.InfoWindowText)
                    .Replace("\r\n", lineBreak)
                    .Replace("\n\r",lineBreak)
                    .Replace("\n", lineBreak)
                    .Replace("\r", lineBreak);
            }
            return html.Replace("'", "''");
        }