示例#1
0
        public bool GetMarkerID(MarkerRequest markerRequest)
        {
            var p    = _paramConverter.ConvertToParameter(markerRequest, "MarkerID");
            var data = dal.ExecSPQuery("getMarkerByIDMarker", con, p);

            if (data.Tables[0].Rows.Count >= 1)
            {
                return(true);
            }
            return(false);
        }
 public Response RemoveMarker(MarkerRequest markerRequest)
 {
     try
     {
         _dalMarker.RemoveMarker(markerRequest);
         return(new ResponseDelMarker());
     }
     catch
     {
         return(new ResponseErr());
     }
 }
示例#3
0
        public Task <SKImage> GetImage(MarkerType type, MarkerColor color)
        {
            lock (requests)
            {
                var path = $"{type.name}_{color?.name ?? ""}";

                if (requests.ContainsKey(path))
                {
                    return(requests[path].completionSource.Task);
                }

                var request = new MarkerRequest {
                    path = path, completionSource = new TaskCompletionSource <SKImage>()
                };
                requests[path] = request;


                void ContinuationFunction(SKImage image)
                {
                    if (color != null)
                    {
                        image = image.ApplyImageFilter(
                            SkiaSharp.SKImageFilter.CreateColorFilter(SkiaSharp.SKColorFilter.CreateLighting(color.ToSKColor(), new SKColor(0, 0, 0))),
                            new SkiaSharp.SKRectI(0, 0, image.Width, image.Height),
                            new SkiaSharp.SKRectI(0, 0, image.Width, image.Height),
                            out var outSUbs,
                            out SKPoint outoffs
                            );
                    }

                    if (type.shadow)
                    {
                        image = image.ApplyImageFilter(
                            SkiaSharp.SKImageFilter.CreateDropShadow(2, 2, 2, 2, SKColors.Black),
                            new SkiaSharp.SKRectI(0, 0, image.Width, image.Height),
                            new SkiaSharp.SKRectI(0, 0, image.Width, image.Height),
                            out var outSUbs2,
                            out SKPoint outoffs2
                            );
                    }

                    request.completionSource.SetResult(image);
                }

                if (type.iconImage != null)
                {
                    ContinuationFunction(type.iconImage);
                }
                else if (type.icon.StartsWith("#"))
                {
                    var image = GenerateProcedural(type.icon);

                    ContinuationFunction(image);
                }
                else
                {
                    ImageDirectory.Instance.GetImage(type.icon)
                    .ContinueWith(
                        x => ContinuationFunction(x.Result));
                }



                return(request.completionSource.Task);
            }
        }
示例#4
0
        public void RemoveMarker(MarkerRequest markerRequest)
        {
            var p = _paramConverter.ConvertToParameter(markerRequest, "MarkerID");

            dal.ExecSPQuery("RemoveMarker", con, p);
        }
 public Response RemoveMarker([FromBody] MarkerRequest markerRequest)
 {
     return(MarkerService.RemoveMarker(markerRequest));
 }