示例#1
0
 void GUI()
 {
     main.Invoke(new MethodInvoker(delegate()
     {
         showFriends = new Friends(this, Bot.DisplayName);
         showFriends.Show();
         showFriends.Activate();
         LoadFriends();
     }));
 }
示例#2
0
文件: Bot.cs 项目: narugo/Mist
 void GUI()
 {
     main.Invoke(new MethodInvoker(delegate()
     {
         showFriends = new Friends(this, Bot.displayName);
         showFriends.Show();
         showFriends.Activate();
         LoadFriends();
         showFriends.friends_list.SetObjects(ListFriends.Get(MistClient.Properties.Settings.Default.OnlineOnly));
     }));
 }
示例#3
0
文件: Bot.cs 项目: Jamyn/Mist
 void GUI()
 {
     main.Invoke(new MethodInvoker(delegate()
     {
         showFriends = new Friends(this, Bot.displayName);
         showFriends.Show();
         showFriends.Activate();
         LoadFriends();
         showFriends.friends_list.SetObjects(ListFriends.Get());
     }));
 }
示例#4
0
        void OnTimerElapsed(object sender, ElapsedEventArgs e)
        {
            byte[] avatarHash = bot.SteamFriends.GetFriendAvatar(bot.SteamUser.SteamID);
            bool validHash = avatarHash != null && !IsZeros(avatarHash);

            if ((AvatarHash == null && !validHash && avatarBox.Image != null) || (AvatarHash != null && AvatarHash.SequenceEqual(avatarHash)))
            {
                // avatar is already up to date, no operations necessary
            }
            else if (validHash)
            {
                AvatarHash = avatarHash;
                CDNCache.DownloadAvatar(bot.SteamUser.SteamID, avatarHash, AvatarDownloaded);
            }
            else
            {
                AvatarHash = null;
                avatarBox.Image = ComposeAvatar(null);
            }
            bot.LoadFriends();
            if (Application.OpenForms.Count < 1)
            {
                Friends friends = new Friends(bot, steam_name.Text);
                friends.Show();
                friends.Activate();
            }
            friends_list.SetObjects(ListFriends.Get(showOnlineFriendsOnlyToolStripMenuItem.Checked));
            Console.WriteLine("Friends list refreshed.");
        }