FlatRedBall.Gui.CollapseItem.Detach C# (CSharp) Méthode

Detach() public méthode

public Detach ( ) : void
Résultat void
        public void Detach()
        {
            ListBoxBase listBoxBase = this.mParentBox as ListBoxBase;

            if (parentItem != null)
            {
                parentItem.mItems.Remove(this);
                parentItem.FixCollapseIcon();
                this.parentItem = null;
            }

            if (listBoxBase.Items.Contains(this) == false)
            {
                listBoxBase.Items.Add(this);
            }
            mParentBox = listBoxBase;

        }

Usage Example

        public CollapseItem AttachItemToThis(CollapseItem itemToAdd)
        {
            if (itemToAdd.parentItem != null)
            {
                itemToAdd.Detach();
            }
            if (itemToAdd.mParentBox as ListBoxBase != null)
            {
                ((ListBoxBase)itemToAdd.mParentBox).Items.Remove(itemToAdd);
            }

            itemToAdd.mParentBox = mParentBox;
            itemToAdd.parentItem = this;


            mItems.Add(itemToAdd);

            FixCollapseIcon();

            if (null != mParentBox as ListBoxBase)
            {
                ((ListBoxBase)mParentBox).AdjustScrollSize();
            }

            return(itemToAdd);
        }
All Usage Examples Of FlatRedBall.Gui.CollapseItem::Detach