Example #1
0
        protected GeometryResult(SerializationInfo info, StreamingContext context)
        {
            if (info is null)
            {
                throw new ArgumentNullException(nameof(info));
            }

            Location           = info.GetValue <LatLngPoint>(LOCATION_FIELD);
            LocationTypeString = info.GetString(LOCATION_TYPE_FIELD);
            Location_Type      = Enum.TryParse <GeometryLocationType>(LocationTypeString, out var type)
                ? type
                : GeometryLocationType.Unknown;
            Viewport = info.GetValue <GeometryViewport>(VIEWPORT_FIELD);
            foreach (var field in info)
            {
                switch (field.Name)
                {
                case nameof(Bounds):
                    Bounds = info.GetValue <GeometryViewport>(field.Name);
                    break;
                }
            }
        }
Example #2
0
 public void SetBounds(LatLngPoint southWest, LatLngPoint northEast)
 {
     Bounds = new GeometryViewport(southWest, northEast);
 }