示例#1
0
        /// <summary>
        /// Executed when the user double click an item or press enter
        /// </summary>
        private void OnActivateItem()
        {
            var curItem = GetCurrentItem();

            if (curItem == null)
            {
                return;
            }

            // Branch clicked : expand/retract
            if (curItem.CanExpand)
            {
                curItem.IsExpanded = !curItem.IsExpanded;
                if (!_expandedBranches.ContainsKey(curItem.DisplayText))
                {
                    _expandedBranches.Add(curItem.DisplayText, curItem.IsExpanded);
                }
                else
                {
                    _expandedBranches[curItem.DisplayText] = curItem.IsExpanded;
                }
                ApplyFilter();
                Npp.GrabFocus();
            }
            else
            {
                // Item clicked : go to line
                Npp.Goto(curItem.DocumentOwner, curItem.GoToLine, curItem.GoToColumn);
                fastOLV.Invalidate();
            }
        }