Beispiel #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            dataGridView2.Columns.Clear();
            ss = new CptS321.Spreadsheet(26, 50);
            ss.CellPropertyChanged      += Form1CellPropertyChanged; //subscription
            dataGridView2.CellBeginEdit += editCell;
            dataGridView2.CellEndEdit   += endEdit;

            for (int i = 65; i <= 90; i++) //ASCII codes for capital letters A - Z
            {
                dataGridView2.Columns.Add(Convert.ToChar(i).ToString(), Convert.ToChar(i).ToString());
            }

            for (int j = 1; j <= 50; j++) //makes 50 rows
            {
                DataGridViewRow row = new DataGridViewRow();
                row.HeaderCell.Value = j.ToString();
                dataGridView2.Rows.Add(row);
            }


            //CptS321.Spreadsheet ss = new CptS321.Spreadsheet(50, 26); create a local form


            //ss.triggerEvent();
        }
Beispiel #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            //clear columns
            DataSheet.Columns.Clear();

            //load CptS321 namespace
            target = new CptS321.Spreadsheet(50, 26);
            target.CellPropertyChanged += new PropertyChangedEventHandler(ToCellChange);

            //creat calumns
            char x = 'A';

            for (int i = 0; i <= 25; i++)
            {
                string y = char.ToString(x);
                DataSheet.Columns.Add(y, y);
                x++;
            }

            //creat rows
            for (int j = 0; j < 50; j++)
            {
                int temp = j + 1;
                DataSheet.Rows.Add();
                DataSheet.Rows[j].HeaderCell.Value = temp.ToString();
            }
        }
Beispiel #3
0
 public void TestGetCell()
 {
     this.sheet = new Spreadsheet(50, 26);
     this.sheet.GetCell(3, 5).Text = "hello";
     Assert.That(this.sheet.GetCell(3, 5).Text, Is.EqualTo("hello"));
 }
Beispiel #4
0
 public void TestSpreadsheetColumnCount()
 {
     this.sheet = new Spreadsheet(3, 5);
     Assert.That(this.sheet.NumberOfColumns, Is.EqualTo(5));
 }
Beispiel #5
0
 public void TestSpreadsheetRowCount()
 {
     this.sheet = new Spreadsheet(8, 3);
     Assert.That(this.sheet.NumberOfRows, Is.EqualTo(8));
 }
Beispiel #6
0
 //Constructor
 public Cell2D(int row, int column) : base(row, column)
 {
     location = Spreadsheet.getLocation(row, column);
 }