private static bool GenerateVariableTypeAndNameList(string[] csvRow, ref List <CsvGridData> variableTypeList,
                                                        ref List <CsvGridData> variableNameList, ref bool findVariableType, ref bool findVariableName)
    {
        ECsvTableRowType rowType = GetTableRowType(csvRow[0], ref findVariableType, ref findVariableName);

        if (rowType == ECsvTableRowType.BlankRow ||
            rowType == ECsvTableRowType.Comment ||
            rowType == ECsvTableRowType.MaxType)
        {
            return(false);
        }

        for (int col = 0; col < csvRow.Length; col++)
        {
            if (rowType == ECsvTableRowType.VariableType)
            {
                string type = CsvDataParser.RemoveStringBlankChar(csvRow[col]);
                if (string.IsNullOrEmpty(type))
                {
                    continue;
                }

                CsvGridData data = new CsvGridData(col, type, rowType);
                variableTypeList.Add(data);
            }

            if (rowType == ECsvTableRowType.VariableName)
            {
                string type = CsvDataParser.RemoveStringBlankChar(csvRow[col]);
                if (string.IsNullOrEmpty(type))
                {
                    continue;
                }

                CsvGridData data = new CsvGridData(col, type, rowType);
                variableNameList.Add(data);
            }
        }

        return(findVariableType && findVariableName);
    }
Exemplo n.º 2
0
 public CsvGridData(int col, string content, ECsvTableRowType rowType)
 {
     this.col     = col;
     this.content = content;
     this.type    = rowType;
 }
Exemplo n.º 3
0
 public CsvGridData()
 {
     col     = 0;
     content = string.Empty;
     type    = ECsvTableRowType.MaxType;
 }