Example #1
0
        /// <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);
            }
        }
Example #2
0
        //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);
                }
            }
        }
Example #3
0
        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);
         }
     });
 }
Example #7
0
        private void Friends_OnFriendRights(object sender, FriendInfoEventArgs e)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new MethodInvoker(() => Friends_OnFriendRights(sender, e)));
                return;
            }

            BeginInvoke(new MethodInvoker(delegate()
            {
                RefreshFriendsList();
            }));
        }
Example #8
0
 private void Friends_OnFriendOnline(object sender, FriendInfoEventArgs e)
 {
     if (Announce)
         Talker.Say("Your friend " + e.Friend.Name + " came on line.");
 }
Example #9
0
 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);
 }
Example #10
0
 public virtual void Friends_OnFriendRights(object sender, FriendInfoEventArgs e) { OnEvent("On-Friend-Rights", paramNamesOnFriendRights, paramTypesOnFriendRights, e); }
Example #11
0
 public virtual void Friends_OnFriendOffline(object sender, FriendInfoEventArgs e) { OnEvent("On-Friend-Offline", paramNamesOnFriendOffline, paramTypesOnFriendOffline, e); }
Example #12
0
 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);
 }