示例#1
0
        public TextCellVM CreateTextBox()
        {
            var textCell = new TextCellVM()
            {
                Content             = "123", Height = 50, Width = 80, CellRow = 0, CellColumn = 0,
                HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Center,
                NameColor           = System.Windows.Media.Colors.White.ToString()
            };

            Cells.Add(textCell);
            selectCell = textCell;
            return(textCell);
        }
示例#2
0
 public void CreateTextOnRow()
 {
     if (Columns == 1)
     {
         while (oldRows < Rows)
         {
             var textCell = new TextCellVM()
             {
                 Content             = "123",
                 Height              = Cells[0].Height,
                 Width               = Cells[0].Width,
                 CellRow             = oldRows,
                 CellColumn          = Columns - 1,
                 HorizontalAlignment = HorizontalAlignment.Stretch,
                 VerticalAlignment   = VerticalAlignment.Center,
                 NameColor           = System.Windows.Media.Colors.White.ToString()
             };
             Height += Cells[0].Height;
             Cells.Add(textCell);
             selectCell = textCell;
             oldRows++;
         }
         return;
     }
     for (; oldRows < Rows; oldRows++)
     {
         Height += Cells[0].Height;
         for (var i = 0; i <= Columns - 1; i++)
         {
             var textCell = new TextCellVM()
             {
                 Content             = "123",
                 Height              = Cells[0].Height,
                 Width               = Cells[0].Width,
                 CellRow             = oldRows,
                 CellColumn          = i,
                 HorizontalAlignment = HorizontalAlignment.Stretch,
                 VerticalAlignment   = VerticalAlignment.Center,
                 NameColor           = System.Windows.Media.Colors.White.ToString()
             };
             Cells.Add(textCell);
             selectCell = textCell;
         }
     }
 }
示例#3
0
 public void CreateTextOnColumn()
 {
     if (Rows == 1)
     {
         while (oldColumns < Columns)
         {
             var textCell = new TextCellVM()
             {
                 Content             = "123",
                 Height              = Cells[0].Height,
                 Width               = Cells[0].Width,
                 CellRow             = Rows - 1,
                 CellColumn          = oldColumns,
                 HorizontalAlignment = HorizontalAlignment.Stretch,
                 VerticalAlignment   = VerticalAlignment.Center,
                 NameColor           = System.Windows.Media.Colors.White.ToString()
             };
             Width += Cells[0].Width;
             Cells.Add(textCell);
             selectCell = textCell;
             oldColumns++;
         }
     }
     for (; oldColumns < Columns; oldColumns++)
     {
         Width += Cells[0].Width;
         for (var i = 0; i <= Rows - 1; i++)
         {
             var textCell = new TextCellVM()
             {
                 Content             = "123",
                 Height              = Cells[0].Height,
                 Width               = Cells[0].Width,
                 CellRow             = i,
                 CellColumn          = oldColumns,
                 HorizontalAlignment = HorizontalAlignment.Stretch,
                 VerticalAlignment   = VerticalAlignment.Center,
                 NameColor           = System.Windows.Media.Colors.White.ToString()
             };
             Cells.Add(textCell);
             selectCell = textCell;
         }
     }
 }
示例#4
0
 public void Initialize()
 {
     _cellVM = new TestCellVM(0, 0);
 }
示例#5
0
        private void AssertFunctionReturnsExpectedValueForIndexInTestData(Func<int> function)
        {
            int index = Convert.ToInt32(TestContext.DataRow["Index"]);
            int expectedRow = Convert.ToInt32(TestContext.DataRow["Expected"]);
            _cellVM = CreateCellVM(index, 0);

            var actualRow = function();

            Assert.AreEqual(expectedRow, actualRow);
        }