Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SpreadsheetItemContainer"/> class.
 /// </summary>
 /// <param name="spreadsheetView">The spreadsheet view.</param>
 public SpreadsheetItemContainer(SpreadsheetView spreadsheetView)
 {
     IsTabStop = false;
     _owner = spreadsheetView;
     if (_owner != null)
         _topLevelSpreadsheet = _owner.GetTopLevelSpreadsheet();
     Cells = new CellCollection();
 }
Ejemplo n.º 2
0
        public void GetTopLevelSpreadsheetMethodTest()
        {
            //Return spreadsheet if spreadsheet.ParentSpreadsheet is null
            var spreadsheet = new SpreadsheetView();
            var topLevelSpreadsheet = spreadsheet.GetTopLevelSpreadsheet();
            Assert.AreEqual(topLevelSpreadsheet, spreadsheet);

            //Return parentSpreadsheet if spreadsheet.ParentSpreadsheet equals parentSpreadsheet
            var parentSpreadsheet = new SpreadsheetView();
            spreadsheet.ParentSpreadsheet = parentSpreadsheet;
            topLevelSpreadsheet = spreadsheet.GetTopLevelSpreadsheet();
            Assert.AreEqual(topLevelSpreadsheet, parentSpreadsheet);
        }