FlatRedBall.Glue.GuiDisplay.PropertyGridMember.SetCategory C# (CSharp) Method

SetCategory() public method

public SetCategory ( string category ) : void
category string
return void
        public void SetCategory(string category)
        {
            // If this thing already has a
            // category attribute then let's
            // replace it.  Otherwise add a new
            // instance
            bool found = false;
            for(int i = 0; i < Attributes.Count; i++)
            {
                Attribute attribute = Attributes[i];
                if (attribute is CategoryAttribute)
                {
                    CategoryAttribute categoryAttribute = new CategoryAttribute(category);
                    Attributes[i] = categoryAttribute;
                    found = true;
                    break;
                }
            }

            if (!found)
            {
                CategoryAttribute categoryAttribute = new CategoryAttribute(category);
                Attributes.Add(categoryAttribute);
            }
        }