Exemple #1
0
 public virtual bool Equals(CargoState other)
 {
     if (null == other)
     {
         return(false);
     }
     if (!this.GetType().Equals(other.GetType()))
     {
         return(false);
     }
     if (!Equals(other as IDelivery))
     {
         return(false);
     }
     if (object.ReferenceEquals(this, other))
     {
         return(true);
     }
     if (!Identifier.Equals(other.Identifier))
     {
         return(false);
     }
     if (!RouteSpecification.Equals(other.RouteSpecification))
     {
         return(false);
     }
     if (!Itinerary.Equals(other.Itinerary))
     {
         return(false);
     }
     return(true);
 }
Exemple #2
0
		public override CargoState AssignToRoute (IItinerary itinerary)
		{
			if(null == itinerary)
				throw new ArgumentNullException("itinerary");
			if(itinerary.Equals(this.Itinerary))
				return this;
			return new NewCargo(this, itinerary);
		}
Exemple #3
0
 public override CargoState AssignToRoute(IItinerary itinerary)
 {
     if (null == itinerary)
     {
         throw new ArgumentNullException("itinerary");
     }
     if (itinerary.Equals(this.Itinerary))
     {
         return(this);
     }
     return(new NewCargo(this, itinerary));
 }