예제 #1
0
        public bool addData(DataRow row)
        {
            try
            {
                if (row != null)
                {
                    if (validator.check(row))
                    {
                        rows.Add(ToolRow.createRowCopy(row));

                        EventHandler h_ = referenceMode.handlerOk; //make backup
                        referenceMode.handlerOk = null;

                        if (h_ != null)
                        {
                            h_.Invoke(this, EventArgs.Empty);//
                        }
                        if (this.getFlagStore().isFlagEnabled(ReferenceFlags.formBatchMode))
                        {
                            this.clear();                 //clear data and handler
                            referenceMode.handlerOk = h_; //will be re-used

                            return(false);                //dont close
                        }

                        return(true);
                    }
                }
                return(false);
            }
            finally
            {
                referenceMode.lastBatchModeIndex = -1;
            }
        }