Exemplo n.º 1
0
 public WorkbookSheet(string name, WorkbookHeader workbookHeader, List <WorkbookColumn> columns, List <WorkbookRow> rows)
 {
     Name           = name;
     WorkbookHeader = workbookHeader;
     Columns        = columns;
     Rows           = rows;
 }
Exemplo n.º 2
0
        public bool Merge(WorkbookHeader other)
        {
            if (!Equals(other))
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 3
0
        public bool Equals(WorkbookHeader other)
        {
            if (Titles.Count != other.Length)
            {
                return(false);
            }

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

            return(true);
        }
Exemplo n.º 4
0
        public bool Merge(WorkbookSheet other)
        {
            if (!WorkbookHeader.Merge(other.WorkbookHeader))
            {
                return(false);
            }

            WorkbookColumn[] backupColumns = new WorkbookColumn[Columns.Count];
            Columns.CopyTo(backupColumns);
            for (int i = 0; i < Columns.Count; i++)
            {
                var column = Columns[i];
                if (!column.Merge(other.Columns[i]))
                {
                    Columns = backupColumns.ToList();
                    return(false);
                }

                Columns[i] = column;
            }

            Rows.AddRange(other.Rows);
            return(true);
        }