Пример #1
0
 /// <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);
 }
Пример #2
0
    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;
    }