Exemplo n.º 1
0
 private void addTypeItemToCollection(TypeCollection collection, TypeItem item)
 {
     if (item.ParentType == 0)
     {
         collection.Add(item);
     }
     else
     {
         foreach (TypeItem temp in collection)
         {
             if (temp.Type == item.ParentType)
             {
                 temp.SubTypeItems.Add(item);
                 break;
             }
         }
     }
 }
Exemplo n.º 2
0
        private bool isTypeItemExist(TypeCollection collection, TypeItem item)
        {
            foreach (TypeItem temp in collection)
            {
                if (temp.Type == item.Type)
                {
                    return(true);
                }

                foreach (TypeItem subTemp in temp.SubTypeItems)
                {
                    if (subTemp.Type == item.Type)
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }