Exemplo n.º 1
0
        /// <summary>
        /// 현재 캐럿이 존재하는 부분의 근처의 텍스트를 읽어서 관련 Method명 출력
        /// </summary>
        private void showIntellisenseBox()
        {
            IntellisenseBox = new CustomListBox();

            m_intellisenseEditIndex = this.linesTextBox1.getCaretNearStringStartEndIndex();

            string inputText = this.linesTextBox1.getCaretNearStringIncludeDot();

            // . 이 있는 경우 - Method
            if (inputText.IndexOf('.') > -1)
            {
                string[] inputTextArr = inputText.Split('.');
                foreach (frmTreeNode depth1Node in nodeList)
                {
                    if (depth1Node.Name.Equals(inputTextArr[0]))
                    {
                        foreach (frmTreeNode depth2Node in depth1Node.Nodes)
                        {
                            if (depth2Node.Name.IndexOf(inputTextArr[1]) > -1)
                            {
                                IntellisenseBox.InsertRow(depth2Node.Name, (string)depth2Node.Text, (string)depth2Node.Tag);
                            }
                        }
                    }
                }
            }
            else
            {
                foreach (frmTreeNode depth1Node in nodeList)
                {
                    if (depth1Node.Name.IndexOf(inputText) > -1)
                    {
                        IntellisenseBox.InsertRow(depth1Node.Name, (string)depth1Node.Text, (string)depth1Node.Tag);
                    }
                }
            }

            if (IntellisenseBox.lineInfo.Count == 0)
            {
                return;
            }

            if (descriptionFinding)
            {
                descriptionBoxSetHide();
            }

            IntellisenseBox.autoSetSizeByViewLineCount();
            IntellisensePopup = new PopupWindow(IntellisenseBox);

            Point loc = getSelectionStartPointLocationByClient();

            ShowWindow(IntellisensePopup.Handle);

            IntellisensePopup.SetBounds(loc.X, loc.Y, IntellisensePopup.Bounds.Width, IntellisensePopup.Bounds.Height);
            IntellisenseBox.selectWord          += tmpBox_selectWord;
            IntellisenseBox.req_viewDescription += IntellisenseBox_req_viewDescription;
            IntellisenseVisible = true;
        }
Exemplo n.º 2
0
 /// <summary>
 /// Intellisense박스 숨기기
 /// </summary>
 private void IntellisesneBoxSetHide()
 {
     IntellisenseBox.selectWord          -= tmpBox_selectWord;
     IntellisenseBox.req_viewDescription -= IntellisenseBox_req_viewDescription;
     intellisenseToolTip.Hide(this);
     IntellisensePopup.Dispose();
     IntellisenseBox.Dispose();
     IntellisenseBox     = null;
     IntellisensePopup   = null;
     IntellisenseVisible = false;
 }