示例#1
0
 private void InitRowBuffer(int cnt)
 {
     if (_rowData != null)
     {
         for (int i = 0; i < cnt; i++)
         {
             IBinaryDataListItem itm = DataListConstants.baseItem.Clone();
             itm.UpdateRecordset(_lastRs);
             _rowData.Add(itm);
         }
     }
 }
示例#2
0
        public void TryPutRecordItemAtIndex(IBinaryDataListItem item, int idx, out string error)
        {
            error = "Is not recordset";
            int myIdx = idx;

            if (IsRecordset)
            {
                if (idx <= FetchLastRecordsetIndex() && _internalObj.ContainsRow(myIdx))
                {
                    int colIdx = InternalFetchColumnIndex(item.FieldName);
                    if (colIdx >= 0)
                    {
                        _internalObj[myIdx] = new List <IBinaryDataListItem> {
                            item
                        };
                        error = string.Empty;
                        _internalObj.IsEmtpy = false;
                        _internalObj.Keys.RemoveGap(myIdx);
                    }
                    else
                    {
                        error = "Mapping error: Column not Found" + item.FieldName;
                    }
                }
                else if (idx >= 1)
                {
                    int colIdx = InternalFetchColumnIndex(item.FieldName);
                    if (colIdx >= 0)
                    {
                        string ns = item.Namespace == string.Empty ? Namespace : item.Namespace;

                        item.UpdateIndex(myIdx);
                        item.UpdateRecordset(ns);
                        IList <IBinaryDataListItem> cols = new List <IBinaryDataListItem> {
                            item
                        };

                        _internalObj[myIdx]  = cols;
                        _internalObj.IsEmtpy = false;
                        _internalObj.Keys.RemoveGap(myIdx);
                        error = string.Empty;
                    }
                    else
                    {
                        error = "Mapping error: Column not found " + item.FieldName;
                    }
                }
            }
        }