/// <summary>
        /// Print the attribute
        ///
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        private TreeViewItem PrintAttribute(AttributeRule item)
        {
            TreeViewItem attributeItem = new TreeViewItem();

            attributeItem.Header = "Attribute - " + item.attributeName;
            if (item.cardinality != "")
            {
                attributeItem.Items.Add("Cardinality: " + item.cardinality);
            }

            List <EntityRule> allEntityRules = item.getEntityRules();

            if (allEntityRules.Any())
            {
                TreeViewItem entityRulesItems = new TreeViewItem();
                entityRulesItems.Header = "EntityRules";
                foreach (var item1 in allEntityRules)
                {
                    TreeViewItem treeViewItem1 = new TreeViewItem();
                    treeViewItem1 = PrintEntityRule(item1);
                    entityRulesItems.Items.Add(treeViewItem1);
                }
                attributeItem.Items.Add(entityRulesItems);
            }
            return(attributeItem);
        }
 private void getEntityRules2(AttributeRule attributeRule)
 {
     foreach (EntityRule er in attributeRule.getEntityRules())
     {
         ChosenEntities.Add(er.entityName);
         foreach (AttributeRule ar in er.getAttributeRules())
         {
             getEntityRules2(ar);
         }
     }
 }
        private void FindEntityRules(AttributeRule AttRule)
        {
            //Console.WriteLine("AttributeName: {0}, EntityRules count: {1}", AttRule.attributeName, AttRule.getEntityRules().Count);
            List <EntityRule> listEnRules = AttRule.getEntityRules();

            foreach (EntityRule en in listEnRules)
            {
                //Console.WriteLine("EntityName={0}", en.entityName);
                ChosenEntities.Add(en.entityName);
                FindAttributeRules(en);
            }
        }