示例#1
0
        public CellValue checkData(int v_col, EXCEL.Cell v_cellData)
        {
            ExcelHeaderDecorate ehd = m_header_dct[v_col];
            string             type = ehd.Type;
            ECellDataStructure ds   = ehd.DataStructure;
            CellValue          val  = null;
            object             data = v_cellData.Value;
            bool success            = false;

            if (data == null || string.IsNullOrEmpty(data.ToString()))
            {
                if (!ehd.CanBeEmpty)
                {
                    Debug.Exception("不可为空");
                    return(new MissVal());
                }
            }
            switch (ds)
            {
            case ECellDataStructure.single:
                val     = CellValue.CheckCellVal(ehd);
                success = val.Init(v_cellData, ehd.get_default(), ehd.get_constraint());
                break;

            case ECellDataStructure.array:
                val = new ListVal(type);
                //val.FieldType = type;
                val.IsStretch = ehd.IsStretch;
                success       = val.Init(v_cellData, ehd.get_default(), ehd.get_constraint());
                break;
            }

            if (success)
            {
                val.IsStretch = ehd.IsStretch;
                return(val);
            }
            else
            {
                val     = new MissVal();
                success = val.Init("[nil]");
                Debug.Exception("没有找到名为{0}类型为{1}的ID", v_cellData.Value, type);
                return(null);
            }
        }
示例#2
0
        public override bool Equals(CellValue v_other)
        {
            ListVal obj = v_other as ListVal;

            return(obj != null && obj._data == _data);
        }