private void AddFuncToBucket(RevitLookupTestFuncInfo newTestFuncInfo)
{
RevitLookupTestFuncInfo tempFuncInfo = null;
ArrayList tmpBucket = null;
// walk the list of buckets. If we see one already there that we belong
// to, just add ourselves. If not, then add a new bucket with the passed
// in testFuncInfo as the first member.
int len = m_funcBuckets.Count;
for (int i = 0; i < len; i++)
{
tmpBucket = (ArrayList)m_funcBuckets[i];
tempFuncInfo = (RevitLookupTestFuncInfo)tmpBucket[0]; // get the first element to compare against
if (newTestFuncInfo.IsCategoryBased)
{
if ((tempFuncInfo.IsCategoryBased) && (tempFuncInfo.Category.CompareTo(newTestFuncInfo.Category) == 0))
{
tmpBucket.Add(newTestFuncInfo);
return;
}
}
else
{
if (!(tempFuncInfo.IsCategoryBased) && (tempFuncInfo.ClassType == newTestFuncInfo.ClassType))
{
tmpBucket.Add(newTestFuncInfo);
return;
}
}
}
// we didn't find an existing bucket, so make a new one and add this as the first item
ArrayList newBucket = new ArrayList();
newBucket.Add(newTestFuncInfo);
m_funcBuckets.Add(newBucket);
}