コード例 #1
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.");
        }
コード例 #2
0
        private void showOnlineFriendsOnlyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            bool checkState = showOnlineFriendsOnlyToolStripMenuItem.Checked;

            Properties.Settings.Default.OnlineOnly = checkState;
            Properties.Settings.Default.Save();
            friends_list.SetObjects(ListFriends.Get(checkState));
        }
コード例 #3
0
 private void text_search_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == 27)
     {
         text_search.Clear();
         this.friends_list.SetObjects(ListFriends.Get(showOnlineFriendsOnlyToolStripMenuItem.Checked));
     }
 }
コード例 #4
0
 private void text_search_Leave(object sender, EventArgs e)
 {
     if (text_search.Text == "")
     {
         text_search.Font      = new Font(text_search.Font, FontStyle.Italic);
         text_search.ForeColor = SystemColors.ControlDark;
         text_search.Text      = "Search";
         this.friends_list.SetObjects(ListFriends.Get(showOnlineFriendsOnlyToolStripMenuItem.Checked));
     }
 }
コード例 #5
0
 private void text_search_TextChanged(object sender, EventArgs e)
 {
     if (text_search.Text == "")
     {
         this.friends_list.SetObjects(ListFriends.Get(showOnlineFriendsOnlyToolStripMenuItem.Checked));
     }
     else
     {
         this.friends_list.SetObjects(ListFriends.Get(text_search.Text));
     }
 }
コード例 #6
0
 private void Friends_Leave(object sender, EventArgs e)
 {
     text_search.Text = "";
     this.friends_list.SetObjects(ListFriends.Get(showOnlineFriendsOnlyToolStripMenuItem.Checked));
     label1.Select();
 }