ArgusTV.Recorders.Common.RecorderTunerServiceBase.CountNumTimesAllocated C# (CSharp) Méthode

CountNumTimesAllocated() protected méthode

Count the number of times a card has been allocated.
protected CountNumTimesAllocated ( ArgusTV.DataContracts.CardChannelAllocation alreadyAllocated, string cardId ) : int
alreadyAllocated ArgusTV.DataContracts.CardChannelAllocation The array of previously allocated cards.
cardId string The ID of the card we want to check.
Résultat int
        protected int CountNumTimesAllocated(CardChannelAllocation[] alreadyAllocated, string cardId)
        {
            int count = 0;
            foreach (CardChannelAllocation allocation in alreadyAllocated)
            {
                if (allocation.CardId == cardId)
                {
                    count++;
                }
            }
            return count;
        }