/// <summary> /// Creates a new population from an existing one and an additional member /// </summary> public EventPopulation(EventPopulation source, IHasState newMember) : this(source.members.Capacity) { this.members.AddRange(source.members); foreach (IHasState member in source.membersHashed) this.membersHashed.Add(member); this.Add(newMember); }
private static bool CheckContains( EventDescriptor evtDesc, EventPopulation currentPop, IHasState newMember) { IList<IHasState> currentMembers = currentPop.Members; int newIndex = currentMembers.Count; for (int i = 0; i < currentMembers.Count; i++) { IHasState currentMember = currentMembers[i]; if (evtDesc.CanEqual(i, newIndex) == false) if (object.ReferenceEquals(currentMember, newMember) == true) return true; } return false; }