-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTeam.cs
49 lines (46 loc) · 1.44 KB
/
Team.cs
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
37
38
39
40
41
42
43
44
45
46
47
48
49
using KosarVezerlo.Forms;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace KosarVezerlo
{
internal class Team
{
public string Code { get; set; }
public string Name { get; set; }
public Color MainColor { get; set; }
public Color SecondColor { get; set; }
public Button TeamButton { get; set; }
public Team(string line)
{
string[] data = line.Split(';') ;
Code = data[0];
Name = data[1].ToUpper();
string[] mc = data[2].Split(',');
string[] sc = data[3].Split(',');
MainColor = Color.FromArgb(int.Parse(mc[0]), int.Parse(mc[1]), int.Parse(mc[2]));
SecondColor = Color.FromArgb(int.Parse(sc[0]), int.Parse(sc[1]), int.Parse(sc[2]));
TeamButton = new Button
{
Name = Name,
Text = Code,
Height = 40,
Width = 80,
BackColor = Color.WhiteSmoke,
ForeColor = Color.Black,
Tag = new Color[2] { MainColor, SecondColor },
};
}
public void SetButtonPosition(int p)
{
TeamButton.Top = 40 * (p / 10 + 1);
TeamButton.Left = 80 * (p % 10);
}
}
}