public PrimaryInterface() { InitializeComponent(); this.Icon = Properties.Resources.favicon; this.Text = "Slack"; this.BackgroundImage = Properties.Resources.background; email = new EmailLogin((r) => { authStart = r; BeginInvoke(new Action(ShowTeams)); }); email.Dock = DockStyle.Fill; email.BackColor = Color.Transparent; Controls.Add(email); }
public TeamList(AuthStartResponse authStart, Action<UserTeamCombo> onSelectTeam) { userTeamCombos = authStart.users; teamSelected = onSelectTeam; buttonFont = new Font(CustomFonts.Fonts.Families[1], 20); teamButtons = new List<CustomButton>(); IEnumerable<CustomButton> buttons = userTeamCombos.Select((c) => CreateTeamButton(c)); int maxWidth = buttons.Max((c) => c.Width); Width = maxWidth; int i = 0; foreach (CustomButton b in buttons) { b.Width = maxWidth; Controls.Add(b); teamButtons.Add(b); } }