public void WriteCell <T>(CellIndex index, T value)
            {
                if (typeof(T) == typeof(string))
                {
                    Document.SetCellValue(index.Row, index.Col, (string)(object)value);
                }

                if (typeof(T) == typeof(int))
                {
                    Document.SetCellValue(index.Row, index.Col, (int)(object)value);
                }

                if (typeof(T) == typeof(long))
                {
                    Document.SetCellValue(index.Row, index.Col, (long)(object)value);
                }

                if (typeof(T) == typeof(double))
                {
                    Document.SetCellValue(index.Row, index.Col, (double)(object)value);
                }

                if (typeof(T) == typeof(DateTime))
                {
                    Document.SetCellValue(index.Row, index.Col, (DateTime)(object)value);
                }

                throw new NotSupportedException(String.Format(
                                                    "Value of type {0} cannot be written to a cell",
                                                    typeof(T).Name));
            }
 public static CellIndex Right(this CellIndex index, CellSize size)
 {
     return(new CellIndex(index.Row, index.Col + size.Width));
 }
 public static CellIndex Down(this CellIndex index, CellSize size)
 {
     return(new CellIndex(index.Row + size.Height, index.Col));
 }
 public CellRange(CellIndex topLeft, CellSize size)
 {
     TopLeft = topLeft;
     Size    = size;
 }