예제 #1
0
파일: SlotBox.cs 프로젝트: lukastk/TakaGUI
        /// <summary>
        /// Removes the drawbox in the slot of the provided handler.
        /// </summary>
        /// <param name="handler"></param>
        protected void RemoveDrawBoxInSlot(SlotHandler handler)
        {
            DrawBox drawBox = Slots[handler].DrawBox;

            if (drawBox.Container != this)
            {
                Debug.AddExceptionInClass(this.GetType(), "RemoveDrawBoxFromSlot", "DrawBox does not have correct container.");
                return;
            }

            if (!drawBox.IsClosed)
            {
                drawBox.Close();
            }

            drawBox.Container = null;
            drawBox.Handler   = null;

            Slots[handler].DrawBox = null;
            drawBoxList.Remove(drawBox);

            DrawBoxHasBeenRemoved(drawBox, handler);

            UpdateSize();
        }