public ICellSpatialFilter Resolve(FilterResult src, CombinedFilter dst, ICellSpatialFilter member, ResolutionContext context) { Fence fence = null; if (src.PolygonGrid != null) { fence = new Fence(); fence.Points = Automapper.Map <List <Point>, List <FencePoint> >(src.PolygonGrid); fence.UpdateExtents(); } else if (src.PolygonLL != null) { fence = new Fence(); fence.Points = Automapper.Map <List <WGSPoint>, List <FencePoint> >(src.PolygonLL); fence.UpdateExtents(); } return(new CellSpatialFilter { CoordsAreGrid = src.PolygonGrid != null, IsSpatial = fence != null, Fence = fence, IsDesignMask = src.DesignFile != null, IsAlignmentMask = src.AlignmentFile != null, AlignmentDesignMaskDesignUID = src.AlignmentFile != null ? src.AlignmentFile.FileUid.Value : Guid.Empty, SurfaceDesignMaskDesignUid = src.DesignFile != null ? src.DesignFile.FileUid.Value : Guid.Empty, StartStation = src.StartStation, EndStation = src.EndStation, LeftOffset = src.LeftOffset, RightOffset = src.RightOffset }); }