Esempio n. 1
0
        /// <summary>
        /// 移除项方法
        /// </summary>
        public virtual void onRemovingItem()
        {
            FCMenu dropDownMenu = null;

            if (m_parentItem != null)
            {
                dropDownMenu = m_parentItem.DropDownMenu;
            }
            else
            {
                dropDownMenu = m_parentMenu;
            }
            if (dropDownMenu != null)
            {
                if (m_items != null && m_items.size() > 0)
                {
                    int itemSize = m_items.size();
                    for (int i = 0; i < itemSize; i++)
                    {
                        m_items.get(i).onRemovingItem();
                    }
                }
                dropDownMenu.removeControl(this);
            }
            if (m_dropDownMenu != null)
            {
                m_parentMenu.Native.removeControl(m_dropDownMenu);
                m_dropDownMenu.delete();
                m_dropDownMenu = null;
            }
        }
Esempio n. 2
0
 /// <summary>
 /// 销毁方法
 /// </summary>
 public override void delete()
 {
     if (!IsDeleted)
     {
         if (m_calendar != null)
         {
             if (m_selectedTimeChangedEvent != null)
             {
                 m_calendar.removeEvent(m_selectedTimeChangedEvent, FCEventID.SELECTEDTIMECHANGED);
                 m_selectedTimeChangedEvent = null;
             }
         }
         if (m_dropDownButton != null)
         {
             if (m_dropDownButtonTouchDownEvent != null)
             {
                 m_dropDownButton.removeEvent(m_dropDownButtonTouchDownEvent, FCEventID.TOUCHDOWN);
                 m_dropDownButtonTouchDownEvent = null;
             }
         }
         if (m_dropDownMenu != null)
         {
             Native.removeControl(m_dropDownMenu);
             m_dropDownMenu.delete();
             m_dropDownMenu = null;
         }
     }
     base.delete();
 }