1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Timers;
using System.Configuration;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows;
using System.Windows.Shapes;
namespace BillardCounter
{
class Billard
{
private static int nbTablesBillard = int.Parse(ConfigurationManager.AppSettings["nbTable"]);
public void createTable()
{
System.Drawing.Rectangle table;
for (int i = 0; i < nbTablesBillard; i++)
{
table = new System.Drawing.Rectangle();
table.Height = 30; table.Width = 50;
table.Margin = new Thickness(i * 150, 0, 0, 0);
table.Fill = Brushes.Green;
table.Visibility = Visibility.Visible;
maGrid.Children.Add(table);
}
}
}
} |
Partager