public void UseObject(IRCConnection.UserInfo userInfo) { this.obj = userInfo; this.label1.Text = userInfo.User.UserName + "@" + userInfo.User.Host; this.label3.Text = string.Format("{0}: {1}{2}{3}{4}", Resources.Nick, userInfo.Nick, userInfo.IsRegistered ? string.Format(" ({0})", Resources.IsRegistered) : string.Empty, userInfo.IsIRCOp ? string.Format(" ({0})", Resources.IRCOp) : string.Empty, userInfo.IsBot ? string.Format(" ({0})", Resources.Bot) : string.Empty); if (userInfo.Idle > 0) { this.label2.Text = string.Format(Resources.IsIdleForSeconds, userInfo.Idle); } else { this.label2.Text = ""; } string name = Resources.RealName + ": " + userInfo.User.Name; if (this.mclName.Text != name) { this.mclName.FormattedText = new FormattedText(name, 1, 99); } this.label5.Text = userInfo.Server; this.label6.Text = userInfo.ServerInfo; this.label7.Text = userInfo.CodePage; this.label8.Text = Resources.Channels; this.label9.Text = string.Empty; foreach (KeyValuePair <string, char> pair in userInfo.Modes) { this.label9.Text += (this.label9.Text.Length > 0 ? " " : "") + pair.Value + pair.Key; } }
public UserInfoPanel(IRCConnection.UserInfo userInfo) { InitializeComponent(); UseObject(userInfo); }