public string GetAttributeType(int categoryIndex, int typeIndex)
        {
            AttributeCategory cat = GetCategory(categoryIndex);

            if (cat == null)
            {
                return(string.Empty);
            }
            if (typeIndex < 0 || typeIndex >= cat.Types.Count)
            {
                return(string.Empty);
            }
            return(cat.Types[typeIndex]);
        }
        public void RenameType(int categoryIndex, int typeIndex, string newName)
        {
            if (categoryIndex < 0 || categoryIndex > Categories.Count)
            {
                return;
            }
            AttributeCategory category = Categories[categoryIndex];

            if (typeIndex < 0 || typeIndex > category.Types.Count)
            {
                return;
            }

            category.Types[typeIndex] = newName;
        }
        public void RemoveType(int categoryIndex, int typeIndex)
        {
            if (categoryIndex < 0 || categoryIndex >= Categories.Count || typeIndex < 0)
            {
                return;
            }
            AttributeCategory category = Categories[categoryIndex];

            if (typeIndex >= category.Types.Count)
            {
                return;
            }
            category.Types.RemoveAt(typeIndex);

            //Test if any attribute uses this type, if so reset the type
            foreach (var attribute in Attributes)
            {
                if (attribute.AttrInfo.type == typeIndex)
                {
                    attribute.AttrInfo.type = 0;
                }
            }
        }