public virtual void RemoveMarineRoutes(MarineRoute __item)
 {
     if (__item != null && marineRoutes != null && marineRoutes.Contains(__item))
     {
         marineRoutes.Remove(__item);
     }
 }
 public virtual void AddMarineRoutes(MarineRoute __item)
 {
     if (__item != null && marineRoutes != null && !marineRoutes.Contains(__item))
     {
         marineRoutes.Add(__item);
     }
 }
Exemplo n.º 3
0
 public virtual void RemoveIncomingMarineRoutes(MarineRoute __item)
 {
     if (__item != null && incomingMarineRoutes != null && incomingMarineRoutes.Contains(__item))
     {
         incomingMarineRoutes.Remove(__item);
         __item.Destination = null;
     }
 }
Exemplo n.º 4
0
 public virtual void RemoveOutgoingMarineRoutes(MarineRoute __item)
 {
     if (__item != null && outgoingMarineRoutes != null && outgoingMarineRoutes.Contains(__item))
     {
         outgoingMarineRoutes.Remove(__item);
         __item.Origin = null;
     }
 }
Exemplo n.º 5
0
 public virtual void RemoveShippingLines(MarineRoute __item)
 {
     if (__item != null && shippingLines != null && shippingLines.Contains(__item))
     {
         shippingLines.Remove(__item);
         __item.Agency = null;
     }
 }
Exemplo n.º 6
0
 public virtual void AddIncomingMarineRoutes(MarineRoute __item)
 {
     if (__item != null && incomingMarineRoutes != null && !incomingMarineRoutes.Contains(__item))
     {
         incomingMarineRoutes.Add(__item);
         if (__item.Destination != this)
         {
             __item.Destination = this;
         }
     }
 }
Exemplo n.º 7
0
 public virtual void AddOutgoingMarineRoutes(MarineRoute __item)
 {
     if (__item != null && outgoingMarineRoutes != null && !outgoingMarineRoutes.Contains(__item))
     {
         outgoingMarineRoutes.Add(__item);
         if (__item.Origin != this)
         {
             __item.Origin = this;
         }
     }
 }
Exemplo n.º 8
0
 public virtual void RemoveShippingLines(MarineRoute __item)
 {
     if (__item != null && shippingLines != null && shippingLines.Contains(__item))
     {
         shippingLines.Remove(__item);
         if (__item.IntermediatePorts.Contains(this))
         {
             __item.RemoveIntermediatePorts(this);
         }
     }
 }
Exemplo n.º 9
0
 public virtual void AddShippingLines(MarineRoute __item)
 {
     if (__item != null && shippingLines != null && !shippingLines.Contains(__item))
     {
         shippingLines.Add(__item);
         if (!__item.IntermediatePorts.Contains(this))
         {
             __item.AddIntermediatePorts(this);
         }
     }
 }
Exemplo n.º 10
0
 public virtual void AddShippingLines(MarineRoute __item)
 {
     if (__item != null && shippingLines != null && !shippingLines.Contains(__item))
     {
         shippingLines.Add(__item);
         if (__item.Agency != this)
         {
             __item.Agency = this;
         }
     }
 }
 public virtual void SetMarineRoutesAt(MarineRoute __item, int __index)
 {
     if (__item == null)
     {
         marineRoutes[__index] = null;
     }
     else
     {
         marineRoutes[__index] = __item;
     }
 }
Exemplo n.º 12
0
 public virtual void SetIncomingMarineRoutesAt(MarineRoute __item, int __index)
 {
     if (__item == null)
     {
         incomingMarineRoutes[__index].Destination = null;
     }
     else
     {
         incomingMarineRoutes[__index] = __item;
         if (__item.Destination != this)
         {
             __item.Destination = this;
         }
     }
 }
Exemplo n.º 13
0
 public virtual void SetOutgoingMarineRoutesAt(MarineRoute __item, int __index)
 {
     if (__item == null)
     {
         outgoingMarineRoutes[__index].Origin = null;
     }
     else
     {
         outgoingMarineRoutes[__index] = __item;
         if (__item.Origin != this)
         {
             __item.Origin = this;
         }
     }
 }
Exemplo n.º 14
0
 public virtual void SetShippingLinesAt(MarineRoute __item, int __index)
 {
     if (__item == null)
     {
         shippingLines[__index].RemoveIntermediatePorts(this);
     }
     else
     {
         shippingLines[__index] = __item;
         if (!__item.IntermediatePorts.Contains(this))
         {
             __item.AddIntermediatePorts(this);
         }
     }
 }
Exemplo n.º 15
0
 public virtual void SetShippingLinesAt(MarineRoute __item, int __index)
 {
     if (__item == null)
     {
         shippingLines[__index].Agency = null;
     }
     else
     {
         shippingLines[__index] = __item;
         if (__item.Agency != this)
         {
             __item.Agency = this;
         }
     }
 }
Exemplo n.º 16
0
/// <summary>
/// Copies the current object to a new instance
/// </summary>
/// <param name="deep">Copy members that refer to objects external to this class (not dependent)</param>
/// <param name="copiedObjects">Objects that should be reused</param>
/// <param name="asNew">Copy the current object as a new one, ready to be persisted, along all its members.</param>
/// <param name="reuseNestedObjects">If asNew is true, this flag if set, forces the reuse of all external objects.</param>
/// <param name="copy">Optional - An existing [MarineRoute] instance to use as the destination.</param>
/// <returns>A copy of the object</returns>
        public virtual MarineRoute Copy(bool deep = false, Hashtable copiedObjects = null, bool asNew = false, bool reuseNestedObjects = false, MarineRoute copy = null)
        {
            if (copiedObjects == null)
            {
                copiedObjects = new Hashtable();
            }
            if (copy == null && copiedObjects.Contains(this))
            {
                return((MarineRoute)copiedObjects[this]);
            }
            copy = copy ?? new MarineRoute();
            if (!asNew)
            {
                copy.TransientId = this.TransientId;
            }
            if (!copiedObjects.Contains(this))
            {
                copiedObjects.Add(this, copy);
            }
            if (deep && this.agency != null)
            {
                if (!copiedObjects.Contains(this.agency))
                {
                    if (asNew && reuseNestedObjects)
                    {
                        copy.Agency = this.Agency;
                    }
                    else if (asNew)
                    {
                        copy.Agency = this.Agency.Copy(deep, copiedObjects, true);
                    }
                    else
                    {
                        copy.agency = this.agency.Copy(deep, copiedObjects, false);
                    }
                }
                else
                {
                    if (asNew)
                    {
                        copy.Agency = (MarineAgency)copiedObjects[this.Agency];
                    }
                    else
                    {
                        copy.agency = (MarineAgency)copiedObjects[this.Agency];
                    }
                }
            }
            copy.intermediatePorts = new List <Port>();
            if (deep && this.intermediatePorts != null)
            {
                foreach (var __item in this.intermediatePorts)
                {
                    if (!copiedObjects.Contains(__item))
                    {
                        if (asNew && reuseNestedObjects)
                        {
                            copy.AddIntermediatePorts(__item);
                        }
                        else
                        {
                            copy.AddIntermediatePorts(__item.Copy(deep, copiedObjects, asNew));
                        }
                    }
                    else
                    {
                        copy.AddIntermediatePorts((Port)copiedObjects[__item]);
                    }
                }
            }
            if (deep && this.ship != null)
            {
                if (!copiedObjects.Contains(this.ship))
                {
                    if (asNew && reuseNestedObjects)
                    {
                        copy.Ship = this.Ship;
                    }
                    else if (asNew)
                    {
                        copy.Ship = this.Ship.Copy(deep, copiedObjects, true);
                    }
                    else
                    {
                        copy.ship = this.ship.Copy(deep, copiedObjects, false);
                    }
                }
                else
                {
                    if (asNew)
                    {
                        copy.Ship = (Ferry)copiedObjects[this.Ship];
                    }
                    else
                    {
                        copy.ship = (Ferry)copiedObjects[this.Ship];
                    }
                }
            }
            if (deep && this.origin != null)
            {
                if (!copiedObjects.Contains(this.origin))
                {
                    if (asNew && reuseNestedObjects)
                    {
                        copy.Origin = this.Origin;
                    }
                    else if (asNew)
                    {
                        copy.Origin = this.Origin.Copy(deep, copiedObjects, true);
                    }
                    else
                    {
                        copy.origin = this.origin.Copy(deep, copiedObjects, false);
                    }
                }
                else
                {
                    if (asNew)
                    {
                        copy.Origin = (Port)copiedObjects[this.Origin];
                    }
                    else
                    {
                        copy.origin = (Port)copiedObjects[this.Origin];
                    }
                }
            }
            if (deep && this.destination != null)
            {
                if (!copiedObjects.Contains(this.destination))
                {
                    if (asNew && reuseNestedObjects)
                    {
                        copy.Destination = this.Destination;
                    }
                    else if (asNew)
                    {
                        copy.Destination = this.Destination.Copy(deep, copiedObjects, true);
                    }
                    else
                    {
                        copy.destination = this.destination.Copy(deep, copiedObjects, false);
                    }
                }
                else
                {
                    if (asNew)
                    {
                        copy.Destination = (Port)copiedObjects[this.Destination];
                    }
                    else
                    {
                        copy.destination = (Port)copiedObjects[this.Destination];
                    }
                }
            }
            base.Copy(deep, copiedObjects, asNew, reuseNestedObjects, copy);
            return(copy);
        }