예제 #1
0
        private void listView_skills_SelectedIndexChanged(object sender, EventArgs e)
        {
            string text = "";

            if (listView_skills.SelectedIndices.Count > 0)
            {
                uint      id = Util.GetUInt32(listView_skills.Items[listView_skills.SelectedIndices[0]].SubItems[2].Text);
                UserSkill us = null;

                if (Globals.SkillListLock.TryEnterReadLock(Globals.THREAD_WAIT_GUI))
                {
                    try
                    {
                        us = Util.GetSkill(id);
                    }
                    finally
                    {
                        Globals.SkillListLock.ExitReadLock();
                    }
                }

                if (us != null)
                {
                    text = Util.GetSkillName(us.ID, us.Level) + Environment.NewLine +
                           "Level: " + us.Level.ToString() + Environment.NewLine +
                           (us.Passive == 0x01 ? "Passive" : "Active") + Environment.NewLine +
                           Util.GetSkillDesc(us.ID, us.Level, 1) + Environment.NewLine +
                           Util.GetSkillDesc(us.ID, us.Level, 2) + Environment.NewLine +
                           Util.GetSkillDesc(us.ID, us.Level, 3) + Environment.NewLine +
                           "Type ID: " + us.ID;
                }
            }

            toolTip1.SetToolTip(listView_skills, text);
        }