Exemplo n.º 1
0
        public virtual bool Equals(Poligono obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return(false);
            }
            if (ReferenceEquals(this, obj))
            {
                return(true);
            }
            if (obj.Radio != Radio)
            {
                return(false);
            }
            if (obj.Puntos.Count != Puntos.Count)
            {
                return(false);
            }

            var thisPoints = ToPointFList();
            var objPoints  = obj.ToPointFList();

            for (var i = 0; i < thisPoints.Count; i++)
            {
                if (!thisPoints[i].Equals(objPoints[i]))
                {
                    return(false);
                }
            }

            return(true);
        }
Exemplo n.º 2
0
        public virtual void AddHistoria(Direccion dir, Poligono pol, DateTime?desde, DateTime?hasta)
        {
            var vigencia = new Vigencia();

            if (desde.HasValue)
            {
                vigencia.Inicio = desde.Value;
            }
            if (hasta.HasValue)
            {
                vigencia.Fin = hasta.Value;
            }

            var historia = from HistoriaGeoRef h in Historia orderby h.Vigencia != null ? h.Vigencia.Inicio : DateTime.MinValue select h;

            foreach (var h in historia)
            {
                if (h.Vigencia == null)
                {
                    h.Vigencia = new Vigencia();
                }
                if (desde.HasValue && h.Vigencia.Vigente(desde.Value))
                {
                    h.Vigencia.Fin = desde.Value;
                }
                else if (hasta.HasValue && h.Vigencia.Vigente(hasta.Value))
                {
                    h.Vigencia.Inicio = hasta.Value;
                }
            }

            var newHistoria = new HistoriaGeoRef {
                ReferenciaGeografica = this, Direccion = dir, Poligono = pol, Vigencia = vigencia
            };

            Historia.Add(newHistoria);
        }
Exemplo n.º 3
0
 public virtual void AddHistoria(Direccion dir, Poligono pol, DateTime?desde)
 {
     AddHistoria(dir, pol, desde, null);
 }