/// <summary>
        /// Function to assign selected person.
        /// </summary>
        /// <param name="personsParty">Instance of PersonsParty</param>
        /// <param name="person">Instance of Person</param>
        /// <param name="gangwayEventProcessType">Gangway event process type</param>
        internal static void AssignSelectedPerson(PersonsParty personsParty, PersonBase person, GangwayEventProcessType? gangwayEventProcessType)
        {
            if (person == null)
            {
                return;
            }

            if (personsParty.SelectedPerson != null)
            {
                personsParty.Guests.Iterate(g => { g.IsSelected = false; g.NotifyPropertyChange("IsSelected"); });
                personsParty.Crew.Iterate(c => { c.IsSelected = false; c.NotifyPropertyChange("IsSelected"); });
                personsParty.Visitors.Iterate(v => { v.IsSelected = false; v.NotifyPropertyChange("IsSelected"); });

                personsParty.SelectedPerson.IsSelected = false;
            }

            if (person.PersonType == PersonType.Guest)
            {
                personsParty.Guests.Where(guest => guest.GuestId.Equals(person.PersonId)).Iterate(guest => guest.IsSelected = true);
            }
            else if (person.PersonType == PersonType.Crewmember)
            {
                personsParty.Crew.Where(crew => crew.CrewmemberId.Equals(person.PersonId)).Iterate(crew => crew.IsSelected = true);
            }
            else if (person.PersonType == PersonType.Visitor)
            {
                personsParty.Visitors.Where(visitor => visitor.VisitorId.Equals(person.PersonId)).Iterate(visitor => visitor.IsSelected = true);
            }

            person.GangwayEventProcessType = gangwayEventProcessType.HasValue ? gangwayEventProcessType.Value : person.GangwayEventProcessType;

            var selectedPerson = RetriveSelectedPersonFromParty(person, personsParty);

            if (selectedPerson != null)
            {
                personsParty.SelectedPerson = selectedPerson;
                personsParty.NotifyPropertyChange("SelectedPerson");
            }
        }
 /// <summary>
 /// Initializes a new instance of the ExternalDeviceInfo class.
 /// </summary>
 /// <param name="id">Identity value</param>
 /// <param name="gangwayEventProcessType">Gangway event process type value</param>
 public ExternalDeviceInfo(string id, GangwayEventProcessType gangwayEventProcessType)
 {
     this.Id = id;
     this.GangwayEventProcessType = gangwayEventProcessType;
 }