public SlackChannelList(ConnectedInterface connected) { parent = connected; starred = new TitledList( "STARRED", connected, (c) => GetLabel(parent.Client.starredChannels[c]), new Label() { Text = "\uF005", Font = new Font(CustomFonts.Fonts.Families[0], 10), ForeColor = Color.FromArgb(0xab, 0x9b, 0xa9) }, -2, (i) => SelectCallback(parent.Client.starredChannels[i]), (i) => true ); channels = new TitledList( "CHANNELS", connected, (i) => GetLabel(parent.Client.Channels[i].id), null, 0, (i) => SelectCallback(connected.Client.Channels[i].id), (i) => true ); users = new TitledList( "DIRECT MESSAGES", connected, (i) => GetUserLabel(connected.Client.UserLookup[connected.Client.DirectMessages[i].user]), null, 0, (i) => SelectCallback(connected.Client.DirectMessages[i].id), (i) => connected.Client.Users[i].presence.Equals("active", StringComparison.InvariantCultureIgnoreCase) ); groups = new TitledList( "PRIVATE GROUPS", connected, (i) => GetLabel(connected.Client.Groups[i].id), null, 0, (i) => SelectCallback(connected.Client.Groups[i].id), (i) => true ); Controls.AddRange(new Control[] { starred, channels, users, groups }); FlushDimensions(); this.AutoScroll = true; parent.Client.BindCallback<PresenceChange>((r) => BeginInvoke(new Action(UpdatePresences)) ); }
public SlackChannelList(ConnectedInterface connected) { parent = connected; starred = new TitledList( "STARRED", connected, (c) => GetLabel(parent.Client.starredChannels[c]), new Label() { Text = "\uF005", Font = new Font(CustomFonts.Fonts.Families[0], 10), ForeColor = Color.FromArgb(0xab, 0x9b, 0xa9) }, -2, (i) => SelectCallback(parent.Client.starredChannels[i]), (i) => true ); channels = new TitledList( "CHANNELS", connected, (i) => GetLabel(parent.Client.Channels[i].id), null, 0, (i) => SelectCallback(connected.Client.Channels[i].id), (i) => true ); users = new TitledList( "DIRECT MESSAGES", connected, (i) => GetUserLabel(connected.Client.UserLookup[connected.Client.DirectMessages[i].user]), null, 0, (i) => SelectCallback(connected.Client.DirectMessages[i].id), (i) => connected.Client.Users[i].presence.Equals("active", StringComparison.InvariantCultureIgnoreCase) ); groups = new TitledList( "PRIVATE GROUPS", connected, (i) => GetLabel(connected.Client.Groups[i].id), null, 0, (i) => SelectCallback(connected.Client.Groups[i].id), (i) => true ); Controls.AddRange(new Control[] { starred, channels, users, groups }); FlushDimensions(); this.AutoScroll = true; parent.Client.BindCallback <PresenceChange>((r) => BeginInvoke(new Action(UpdatePresences)) ); }
int SetHeight(TitledList c, int previous, int margin) { if (c.entries == null || c.entries.Length == 0) { c.Visible = false; } else { c.Height = c.PreferredSize.Height; c.Location = new Point(x, previous + margin); c.Visible = true; return(c.Bottom + margin); } return(previous); }
int SetHeight(TitledList c, int previous, int margin) { if (c.entries == null || c.entries.Length == 0) c.Visible = false; else { c.Height = c.PreferredSize.Height; c.Location = new Point(x, previous + margin); c.Visible = true; return c.Bottom + margin; } return previous; }