/// <summary>Raises the FriendRightsUpdate event</summary> /// <param name="e">A FriendInfoEventArgs object containing the /// data returned from the data server</param> protected virtual void OnFriendRights(FriendInfoEventArgs e) { EventHandler <FriendInfoEventArgs> handler = m_FriendRights; if (handler != null) { handler(this, e); } }
//Separate thread private void Friends_OnFriendOnline(object sender, FriendInfoEventArgs e) { if (InvokeRequired) { BeginInvoke(new MethodInvoker(() => Friends_OnFriendOnline(sender, e))); return; } if (!string.IsNullOrEmpty(e.Friend.Name) && !string.IsNullOrEmpty(avname)) { if (!instance.Config.CurrentConfig.DisableFriendsNotifications) { if (instance.Config.CurrentConfig.PlayFriendOnline) { SoundPlayer simpleSound = new SoundPlayer(Properties.Resources.Friend_On); simpleSound.Play(); simpleSound.Dispose(); } string ttl = "METAbolt Alert"; string body = e.Friend.Name + " is online"; TrayNotifiy(ttl, body, false); } } }
void Friends_FriendOnline(object sender, FriendInfoEventArgs e) { if (!instance.GlobalSettings["show_friends_online_notifications"]) return; ThreadPool.QueueUserWorkItem(sync => { string name = instance.Names.Get(e.Friend.UUID, true); MethodInvoker display = () => { DisplayNotification(e.Friend.UUID, name + " is online"); RefreshFriendsList(); }; if (InvokeRequired) { BeginInvoke(display); } else { display(); } }); }
/// <summary>Raises the FriendRightsUpdate event</summary> /// <param name="e">A FriendInfoEventArgs object containing the /// data returned from the data server</param> protected virtual void OnFriendRights(FriendInfoEventArgs e) { EventHandler<FriendInfoEventArgs> handler = m_FriendRights; if (handler != null) handler(this, e); }
void Friends_FriendOnline(object sender, FriendInfoEventArgs e) { if (!instance.GlobalSettings["show_friends_online_notifications"]) return; ThreadPool.QueueUserWorkItem(sync => { string name = instance.Names.Get(e.Friend.UUID, true); MethodInvoker display = () => { instance.MainForm.TabConsole.DisplayNotificationInChat(name + " is online", ChatBufferTextStyle.ObjectChat, instance.GlobalSettings["friends_notification_highlight"]); RefreshFriendsList(); }; if (InvokeRequired) { BeginInvoke(display); } else { display(); } }); }
void Friends_FriendRightsUpdate(object sender, FriendInfoEventArgs e) { Gtk.Application.Invoke(delegate { lock (store) { store.Foreach(myfunc); } }); }
private void Friends_OnFriendRights(object sender, FriendInfoEventArgs e) { if (InvokeRequired) { BeginInvoke(new MethodInvoker(() => Friends_OnFriendRights(sender, e))); return; } BeginInvoke(new MethodInvoker(delegate() { RefreshFriendsList(); })); }
private void Friends_OnFriendOnline(object sender, FriendInfoEventArgs e) { if (Announce) Talker.Say("Your friend " + e.Friend.Name + " came on line."); }
public void Friends_FriendRightsUpdate(object sender, FriendInfoEventArgs e) { Hashtable hash = new Hashtable(); hash.Add("MessageType", "FriendRightsChanged"); hash.Add("Name", e.Friend.Name); hash.Add("ID", e.Friend.UUID); hash.Add("TheirRights", e.Friend.TheirFriendRights); hash.Add("MyRights", e.Friend.MyFriendRights); hash.Add("Online", e.Friend.IsOnline); enqueue(hash); }
public virtual void Friends_OnFriendRights(object sender, FriendInfoEventArgs e) { OnEvent("On-Friend-Rights", paramNamesOnFriendRights, paramTypesOnFriendRights, e); }
public virtual void Friends_OnFriendOffline(object sender, FriendInfoEventArgs e) { OnEvent("On-Friend-Offline", paramNamesOnFriendOffline, paramTypesOnFriendOffline, e); }
public void Friends_FriendOnOffline(object sender, FriendInfoEventArgs e) { Hashtable hash = new Hashtable(); hash.Add("MT", "fstatus"); hash.Add("name", e.Friend.Name); //hash.Add("ID", e.Friend.UUID); //hash.Add("TheirRights", e.Friend.TheirFriendRights); //hash.Add("MyRights", e.Friend.MyFriendRights); hash.Add("on", e.Friend.IsOnline); enqueue(hash); }