コード例 #1
0
        /// <summary>
        /// 删除类
        /// </summary>
        public void deleteClass()
        {
            List <FCGridRow> selectedRows = m_tvCollection.SelectedRows;
            int selectedRowsSize          = selectedRows.Count;

            if (selectedRowsSize > 0)
            {
                if (m_collectionName == "TabPages")
                {
                    FCTabControl tabControl = m_target as FCTabControl;
                    FCTabPage    tabPage    = selectedRows[0].Tag as FCTabPage;
                    m_xml.removeControl(tabPage);
                    m_tvCollection.removeRow(selectedRows[0]);
                    m_tvCollection.update();
                    tabControl.update();
                }
                else if (m_collectionName == "Columns")
                {
                    FCGrid       grid   = m_target as FCGrid;
                    FCGridColumn column = selectedRows[0].Tag as FCGridColumn;
                    grid.removeColumn(column);
                    m_xml.m_controls.Remove(column);
                    m_xml.Nodes[column].ParentNode.RemoveChild(m_xml.Nodes[column]);
                    m_xml.Nodes.Remove(column);
                    m_tvCollection.removeRow(selectedRows[0]);
                    m_tvCollection.update();
                    grid.update();
                }
                Native.invalidate();
                m_designerDiv.saveUndo();
            }
        }
コード例 #2
0
        /// <summary>
        /// 移除节点方法
        /// </summary>
        public virtual void onRemovingNode()
        {
            m_indent = 0;
            FCGridRow row = Row;

            if (row != null)
            {
                if (m_nodes != null && m_nodes.size() > 0)
                {
                    int nodeSize = m_nodes.size();
                    for (int i = 0; i < nodeSize; i++)
                    {
                        m_nodes.get(i).onRemovingNode();
                    }
                }
                m_tree.removeRow(row);
                row.clearCells();
                Row = null;
                ArrayList <FCGridRow> rows = m_tree.getRows();
                int rowSize = rows.size();
                for (int i = 0; i < rowSize; i++)
                {
                    rows.get(i).Index = i;
                }
                m_targetColumn = null;
            }
        }