Inheritance: SirenOfShame.Lib.UserControlBase
Esempio n. 1
0
        private void AddUserPanel(ImageList avatarImageList, PersonSetting person)
        {
            UserPanel userPanel = new UserPanel(person, avatarImageList)
            {
                Cursor  = Cursors.Hand,
                Visible = !person.Hidden
            };

            userPanel.AddMouseUpToAllControls(UserPanelMouseUp);
            userPanel.AddMouseEnterToAllControls(UserPanelMouseEnter);

            _usersPanel.Controls.Add(userPanel);
        }
Esempio n. 2
0
        public void Initialize(SirenOfShameSettings settings, ImageList avatarImageList)
        {
            Settings = settings;

            var peopleByReputation = settings.People.OrderByDescending(i => i.GetReputation());
            foreach (var person in peopleByReputation)
            {
                UserPanel userPanel = new UserPanel(person, avatarImageList)
                                          {
                                              Cursor = Cursors.Hand,
                                              Visible = !person.Hidden
                                          };

                userPanel.AddMouseUpToAllControls(UserPanelMouseUp);
                userPanel.AddMouseEnterToAllControls(UserPanelMouseEnter);

                _usersPanel.Controls.Add(userPanel);
            }
        }
Esempio n. 3
0
        public void Initialize(SirenOfShameSettings settings, ImageList avatarImageList)
        {
            Settings = settings;

            var peopleByReputation = settings.People.OrderByDescending(i => i.GetReputation());

            foreach (var person in peopleByReputation)
            {
                UserPanel userPanel = new UserPanel(person, avatarImageList)
                {
                    Cursor  = Cursors.Hand,
                    Visible = !person.Hidden
                };

                userPanel.AddMouseUpToAllControls(UserPanelMouseUp);
                userPanel.AddMouseEnterToAllControls(UserPanelMouseEnter);

                _usersPanel.Controls.Add(userPanel);
            }
        }
Esempio n. 4
0
        private void UserPanelMouseUp(object sender, MouseEventArgs e)
        {
            UserPanel userPanel = TraverseParentsUntilUserPanel((Control)sender);

            if (userPanel == null)
            {
                return;
            }

            if (e.Button == MouseButtons.Right)
            {
                _selectedRawName = userPanel.RawName;
                _userMenu.Show((Control)sender, e.Location);
                var person = _settings.FindPersonByRawName(_selectedRawName);
                _hiddenButton.Checked = person.Hidden;
            }

            if (e.Button == MouseButtons.Left)
            {
                InvokeOnUserSelected(userPanel.RawName);
            }
        }
        private void AddUserPanel(ImageList avatarImageList, PersonSetting person)
        {
            UserPanel userPanel = new UserPanel(person, avatarImageList)
            {
                Cursor = Cursors.Hand,
                Visible = !person.Hidden
            };

            userPanel.AddMouseUpToAllControls(UserPanelMouseUp);
            userPanel.AddMouseEnterToAllControls(UserPanelMouseEnter);

            _usersPanel.Controls.Add(userPanel);
        }