protected virtual void OnUserAvail(IMAvailEventArgs e) { if (UserAvailable != null) { UserAvailable(this, e); } }
private void OnIm_UserAvailable(object sender, IMAvailEventArgs e) { if (e.Username == sendTo) { if (e.IsAvailable != lastAvail) { this.BeginInvoke(new MethodInvoker(delegate { lastAvail = e.IsAvailable; this.sendTextBox.Enabled = true; string avail = (lastAvail ? "Available" : "Unavailable"); this.sendTextBox.Enabled = lastAvail; this.talkTextBox.Text += string.Format("[{0} is {1}]\r\n", sendTo, avail); })); } } }