Inheritance: SirenOfShame.Lib.UserControlBase
Exemplo 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);
        }
Exemplo 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);
            }
        }
Exemplo 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);
            }
        }
Exemplo 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);
            }
        }
Exemplo n.º 5
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);
        }