private void btnUsername_Click(object sender, EventArgs ea) { _username = tbUsername.Text.Trim(); _connection = new JmsConnection(_username); _connection.ChatListUpdateDelegate += UpdateChatList; _connection.ChatMessageUpdateDelegate += UpdateChatMessages; FormClosing += (s, e) => { _connection.Disconnect(); }; panelUsername.Visible = false; lblUsername.Text = _username; FormTransform.TransformSize(this, Width, 490); }
private void OpenConversation(Conversation c) { _connection.ActiveConversation = c; var conversation = c as GroupConversation; gbConversation.Text = conversation != null?conversation.GetGroupName() : ((PersonalConversation)c).GetAuthor(); UpdateChatMessages(); if (Width != 834) { FormTransform.TransformSize(this, 834, Height); } }
private void advancedSettingsCB_CheckedChanged(object sender, EventArgs e) { Point oldLoc = this.Location; Size oldSz = this.Size; Size sz = new Size(525, 275); if (this.advancedSettingsCB.Checked) { sz = new Size(775, 455); } Point loc = new Point(oldLoc.X + (oldSz.Width - sz.Width) / 2, oldLoc.Y + (oldSz.Height - sz.Height) / 2); FormTransform.Transform(this, sz, loc); }