Esempio n. 1
0
        public static int ReadValueCsvLoc(CsvSpreadSheet sheet, int index, string headerName)
        {
            int row    = sheet.GetRecord(index).StartRow;
            int column = sheet.GetHeaderRecord(headerName).Index;

            if (string.IsNullOrEmpty(sheet.GetValue(row, column)))
            {
                return(0);
            }
            else
            {
                return(LocalizationCsvData.IdRecordValue[sheet.GetValue(row, column)]);
            }
        }
Esempio n. 2
0
        public static int ReadValueCsvRecordId(CsvSpreadSheet sheet, int index, string headerName)
        {
            int row    = sheet.GetRecord(index).StartRow;
            int column = sheet.GetHeaderRecord(headerName).Index;

            return(ParseCsvRecordId(sheet.GetValue(row, column)));
        }
Esempio n. 3
0
        public static int[] ReadValueLocArrayLine(CsvSpreadSheet sheet, int index, string headerName)
        {
            int row    = sheet.GetRecord(index).StartRow;
            int column = sheet.GetHeaderRecord(headerName).Index;
            var line   = sheet.GetValue(row, column).Split(new Char[] { '|', '#' });

            int[] result = new int[line.Length];
            for (int i = 0; i < line.Length; i++)
            {
                if (string.IsNullOrEmpty(sheet.GetValue(row + i, column)))
                {
                    result[i] = 0;
                }
                else
                {
                    result[i] = LocalizationCsvData.IdRecordValue[sheet.GetValue(i + row, column)];
                }
            }
            return(result);
        }
Esempio n. 4
0
        public static int[] ReadValueLocArray(CsvSpreadSheet sheet, int index, string headerName)
        {
            int row    = sheet.GetRecord(index).StartRow;
            int column = sheet.GetHeaderRecord(headerName).Index;
            int len    = sheet.GetRecord(index).HeaderContentLength[column];

            int[] result = new int[len];
            for (int i = 0; i < len; i++)
            {
                if (string.IsNullOrEmpty(sheet.GetValue(row + i, column)))
                {
                    result[i] = 0;
                }
                else
                {
                    result[i] = LocalizationCsvData.IdRecordValue[sheet.GetValue(i + row, column)];
                }
            }
            return(result);
        }
Esempio n. 5
0
        public static int ReadValueDicValue(CsvSpreadSheet sheet, int index, string headerName)
        {
            if (headerName == "_VALUE" && sheet.dicWithoutValue)
            {
                return(sheet.Records[index].KeyValue);
            }

            int row    = sheet.GetRecord(index).StartRow;
            int column = sheet.GetHeaderRecord(headerName).Index;

            return(ParseInt(sheet.GetValue(row, column)));
        }
Esempio n. 6
0
        public static int[] ReadValueCsvIdArrayLine(CsvSpreadSheet sheet, int index, string headerName)
        {
            int row    = sheet.GetRecord(index).StartRow;
            int column = sheet.GetHeaderRecord(headerName).Index;
            var line   = sheet.GetValue(row, column).Split(new Char[] { '|', '#' });

            int[] result = new int[line.Length];
            for (int i = 0; i < line.Length; i++)
            {
                result[i] = ParseCsvRecordId(line[i]);
            }
            return(result);
        }
Esempio n. 7
0
        public static decimal[] ReadValueDecimalArrayLine(CsvSpreadSheet sheet, int index, string headerName)
        {
            int row    = sheet.GetRecord(index).StartRow;
            int column = sheet.GetHeaderRecord(headerName).Index;
            var v      = sheet.GetValue(row, column);

            string[] line;
            if (string.IsNullOrEmpty(v))
            {
                line = new string[0];
            }
            else
            {
                line = sheet.GetValue(row, column).Split(new Char[] { '|', '#' });
            }
            decimal[] result = new decimal[line.Length];
            for (int i = 0; i < line.Length; i++)
            {
                result[i] = ParseDecimal(line[i]);
            }
            return(result);
        }
Esempio n. 8
0
        public static int[][] ReadValueLocArray2(CsvSpreadSheet sheet, int index, string headerName)
        {
            int row    = sheet.GetRecord(index).StartRow;
            int column = sheet.GetHeaderRecord(headerName).Index;
            int len    = sheet.GetRecord(index).HeaderContentLength[column];

            int[][] result = new int[len][];

            for (int i = 0; i < len; i++)
            {
                result[i] = ParseCsvRecordLocArray(sheet.GetValue(i + row, column));
            }
            return(result);
        }