Пример #1
0
        public WorkbookHeader(WorkbookRow row)
        {
            Type          stringType = typeof(string);
            List <string> titles     = new List <string>(row.Length);

            foreach (WorkbookCell cell in row)
            {
                if (cell.CellType != stringType)
                {
                    throw new InvalidCastException($"Each cell in WorkbookRow must be a string cell to convert into WorkbookHeader.");
                }
                titles.Add((string)cell.Value);
            }

            Titles = titles;
        }
Пример #2
0
        public bool Equals(WorkbookRow other)
        {
            if (Length != other.Length)
            {
                return(false);
            }

            for (int i = 0; i < Length; i++)
            {
                if (!_cells[i].Equals(other[i]))
                {
                    return(false);
                }
            }

            return(true);
        }