Пример #1
0
        public void ShowContextMenu(Control displayControl, FriendControl friendControl, Point point)
        {
            if (friendControl.Friend.SteamID == SteamContext.SteamUser.GetSteamID())
            {
                return;
            }

            contextMenu.Show(displayControl, point);
            contextMenu.Tag = friendControl;
        }
Пример #2
0
        private void removeAliasToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FriendControl fc = contextMenu.Tag as FriendControl;

            if (fc == null)
            {
                return;
            }

            SteamContext.ClientFriends.SetFriendAlias(fc.Friend.SteamID, "");
        }
Пример #3
0
        void HandleStateChange(PersonaStateChange_t param)
        {
            FriendControl fc = friendsFlow.GetFriendControl(new Friend(param.m_ulSteamID));

            if (fc == null)
            {
                return;
            }

            // force update
            fc.SetSteamID(fc.Friend);
        }
Пример #4
0
        private void setAliasToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FriendControl fc = contextMenu.Tag as FriendControl;

            if (fc == null)
            {
                return;
            }

            AliasForm af = new AliasForm();

            if (af.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }

            SteamContext.ClientFriends.SetFriendAlias(fc.Friend.SteamID, af.Alias);
        }
Пример #5
0
        void ReloadFriends()
        {
            List<Friend> friendsList = GetFriends();

            friendsList.Sort( ( a, b ) =>
            {
                if ( a.IsInGame() && b.IsInGame() )
                    return StringComparer.OrdinalIgnoreCase.Compare( a.GetName(), b.GetName() );

                if ( !a.IsOnline() && !b.IsOnline() )
                    return StringComparer.OrdinalIgnoreCase.Compare( a.GetName(), b.GetName() );

                if ( a.IsOnline() && !a.IsInGame() && b.IsOnline() && !b.IsInGame() )
                    return StringComparer.OrdinalIgnoreCase.Compare( a.GetName(), b.GetName() );

                if ( a.IsInGame() && !b.IsInGame() )
                    return -1;

                if ( a.IsOnline() && !b.IsOnline() )
                    return -1;

                if ( !a.IsInGame() && b.IsInGame() )
                    return 1;

                if ( !a.IsOnline() && b.IsOnline() )
                    return 1;

                return 0;

            } );

            int scroll = friendsFlow.VerticalScroll.Value;

            friendsFlow.SuspendLayout();
            friendsFlow.Controls.Clear();

            foreach ( Friend friend in friendsList )
            {
                FriendControl fc = new FriendControl( friend );

                friendsFlow.Controls.Add( fc );
            }

            ResizeFriends();

            friendsFlow.ResumeLayout();
            friendsFlow.PerformLayout();
            friendsFlow.Refresh();

            friendsFlow.VerticalScroll.Value = scroll;
        }
Пример #6
0
        public void ShowContextMenu( Control displayControl, FriendControl friendControl, Point point )
        {
            if ( friendControl.Friend.SteamID == SteamContext.SteamUser.GetSteamID() )
                return;

            contextMenu.Show( displayControl, point );
            contextMenu.Tag = friendControl;
        }
Пример #7
0
        void ReloadFriends()
        {
            List <Friend> friendsList = GetFriends();

            friendsList.Sort((a, b) =>
            {
                if (a.IsInGame() && b.IsInGame())
                {
                    return(StringComparer.OrdinalIgnoreCase.Compare(a.GetName(), b.GetName()));
                }

                if (!a.IsOnline() && !b.IsOnline())
                {
                    return(StringComparer.OrdinalIgnoreCase.Compare(a.GetName(), b.GetName()));
                }

                if (a.IsOnline() && !a.IsInGame() && b.IsOnline() && !b.IsInGame())
                {
                    return(StringComparer.OrdinalIgnoreCase.Compare(a.GetName(), b.GetName()));
                }

                if (a.IsInGame() && !b.IsInGame())
                {
                    return(-1);
                }

                if (a.IsOnline() && !b.IsOnline())
                {
                    return(-1);
                }

                if (!a.IsInGame() && b.IsInGame())
                {
                    return(1);
                }

                if (!a.IsOnline() && b.IsOnline())
                {
                    return(1);
                }

                return(0);
            });

            int scroll = friendsFlow.VerticalScroll.Value;

            friendsFlow.SuspendLayout();
            friendsFlow.Controls.Clear();

            foreach (Friend friend in friendsList)
            {
                FriendControl fc = new FriendControl(friend);

                friendsFlow.Controls.Add(fc);
            }

            ResizeFriends();

            friendsFlow.ResumeLayout();
            friendsFlow.PerformLayout();
            friendsFlow.Refresh();

            friendsFlow.VerticalScroll.Value = scroll;
        }