Exemplo n.º 1
0
 private void OpenNewsPaperBtn_Click(object sender, EventArgs e)
 {
     if (newsPaperForm == null || newsPaperForm.IsDisposed)
     {
         newsPaperForm = new NewsPaperForm(stockMarket);
         SetBoardProperties(newsPaperForm, "News Paper", Color.LightSeaGreen);
         stockMarket.Attach((IObserver)newsPaperForm);
     }
     newsPaperForm.Show();
 }
Exemplo n.º 2
0
 private void OpenMatrixBoardBtn_Click(object sender, EventArgs e)
 {
     if (matrixBoardForm == null || matrixBoardForm.IsDisposed)
     {
         matrixBoardForm = new MatrixBoardForm(stockMarket);
         SetBoardProperties(matrixBoardForm, "Matrix Board", Color.DarkSalmon);
         // Attach
         stockMarket.Attach((IObserver)matrixBoardForm);
     }
     matrixBoardForm.Show();
 }
Exemplo n.º 3
0
 private void SetBoardProperties(BoardForm board, string text, Color boardColor)
 {
     board.Text      = text;
     board.BackColor = boardColor;
 }