Exemplo n.º 1
0
        /// <summary>
        /// Called in order to delete a data row from the worksheet.  This method does
        /// some operations prior to the actual row delete in order to keep the delta
        /// plot bookkeeping going. </summary>
        /// <param name="row"> the row to delete. </param>
        public virtual void preDeleteRow(int row)
        {
            if (row < 0 || row >= _rows)
            {
                return;
            }

            __worksheet.editingCanceled(new [email protected](__worksheet));

            if (row < (_rows - 1))
            {
                string dfile = (string)(getValueAt(row, COL_FILE));
                string file  = (string)(getValueAt(row + 1, COL_FILE));
                string dtype = (string)(getValueAt(row, COL_TYPE));
                string type  = (string)(getValueAt(row + 1, COL_TYPE));
                string dparm = (string)(getValueAt(row, COL_PARM));
                string parm  = (string)(getValueAt(row + 1, COL_PARM));
                string dyear = (string)(getValueAt(row, COL_YEAR));
                string year  = (string)(getValueAt(row + 1, COL_YEAR));
                string did   = (string)(getValueAt(row, COL_ID));
                string id    = (string)(getValueAt(row + 1, COL_ID));

                if (file.Equals(""))
                {
                    if (!dfile.Equals(""))
                    {
                        setValueAt(dfile, row + 1, COL_FILE);
                    }
                }
                if (type.Equals(""))
                {
                    if (!dtype.Equals(""))
                    {
                        setValueAt(dtype, row + 1, COL_TYPE);
                    }
                }
                if (parm.Equals(""))
                {
                    if (!dparm.Equals(""))
                    {
                        setValueAt(dparm, row + 1, COL_PARM);
                    }
                }
                if (year.Equals(""))
                {
                    if (!dyear.Equals(""))
                    {
                        setValueAt(dyear, row + 1, COL_YEAR);
                    }
                }
                if (id.Equals(""))
                {
                    if (!did.Equals(""))
                    {
                        setValueAt(did, row + 1, COL_ID);
                    }
                }
            }

            __worksheet.deleteRow(row);
        }