public DGPMessenger() { byteBufferSize = 1024; byteBuffer = new byte[byteBufferSize]; messageBuffer = ""; user = new User(); loggingIn = false; _connected = false; }
public MessageForm(User user, DGPContact contact, Socket socket) { initData(); this.user = user; this._contact = contact; this._clientSocket = socket; this.SetDGPContactName( _contact.Name); //this.DisplayMessage("Till : " + contact.Name + "\n", Color.Purple, ""); }
/// <summary> /// Set variables that are set for all constructors /// </summary> private void initData() { // // Required for Windows Form Designer support // InitializeComponent(); SetStyle(ControlStyles.ResizeRedraw, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.DoubleBuffer, true); this._active = false; this._clientSocket = null; this.user = new User(); }
private MessageForm NewMessageForm(User user, string contactId, Socket socket, bool activate) { DGPContact contact = new DGPContact(contactId, contactId, OnlineStatus.OFFLINE); foreach(DGPContact fr in listBox1.Items) { if(fr.Id == contactId) { contact = fr; } } MessageForm messageForm = new MessageForm(user, contact, socket); NewMessageFormCreated(messageForm); messageForm.Active = activate; if(activate) { messageForm.BringToFront(); } return messageForm; }