Beispiel #1
0
        private void RateStarList_Click(object sender, EventArgs e)
        {
            foreach (var star in RateStarList)
            {
                if (sender.Equals(star))
                {
                    var selection = RateStarList.IndexOf(star);
                    if (m_isLocked && selection < m_currentRating - 1)
                    {
                        m_currentRating = RateStarList.IndexOf(star) + 1;
                        Console.WriteLine(m_currentRating);
                        for (int i = m_currentRating; i < RateStarList.Count; i++)
                        {
                            RateStarList[i].Image = Properties.Resources.star_inactive;
                        }

                        return;
                    }
                    m_currentRating = RateStarList.IndexOf(star) + 1;
                    m_isLocked      = true;
                    ChangeStarImage(RateStarList, m_currentRating - 1, true);
                    Console.WriteLine(m_currentRating);
                }
            }
        }
Beispiel #2
0
        private void RateStarList_MouseLeave(object sender, EventArgs e)
        {
            if (m_isLocked)
            {
                return;
            }

            foreach (var star in RateStarList)
            {
                if (sender.Equals(star))
                {
                    ChangeStarImage(RateStarList, RateStarList.IndexOf(star), false);
                    m_currentRating = 0;
                    Console.WriteLine(m_currentRating);
                }
            }
        }
Beispiel #3
0
        private void RateStarList_MouseEnter(object sender, EventArgs e)
        {
            if (m_isLocked)
            {
                return;
            }

            foreach (var star in RateStarList)
            {
                if (sender.Equals(star))
                {
                    var selectedStars = RateStarList.IndexOf(star);
                    m_currentRating = selectedStars + 1;
                    ChangeStarImage(RateStarList, selectedStars, true);
                    Console.WriteLine(m_currentRating);
                }
            }
        }