예제 #1
0
        /// <summary>
        /// Event for double clicking an item
        /// </summary>
        /// <param name="sender">object that fired the event</param>
        /// <param name="e">event arguments</param>
        private void LstView_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            var lstView = (ListView)sender;

            if (lstView == null)
            {
                return;
            }

            var lstItem = lstView.GetItemAt(e.X, e.Y);

            if (lstItem == null)
            {
                return;
            }

            var loc = (SledVarLocationType)lstItem.Tag;

            if (loc == null)
            {
                return;
            }

            // Store selected variable
            SelectedLocation = loc;

            // Close form
            DialogResult = DialogResult.OK;
        }
예제 #2
0
        /// <summary>
        /// Add location to the list
        /// </summary>
        /// <param name="loc"></param>
        /// <param name="lineText"></param>
        public void AddLocation(SledVarLocationType loc, string lineText)
        {
            var lstItem =
                new ListViewItem(
                    new[]
            {
                SledUtil.GetRelativePath(loc.File, m_projectService.Get.AssetDirectory),
                loc.Line.ToString(),
                loc.Occurence.ToString(),
                lineText
            })
            {
                Tag = loc
            };

            m_lstView.Items.Add(lstItem);

            m_lstView.Columns[0].Width = -1;
            m_lstView.Columns[1].Width = -1;
            m_lstView.Columns[2].Width = -1;
            m_lstView.Columns[3].Width = -2;
        }