Exemple #1
0
        private void tvClassView_AfterSelect(object sender, TreeViewEventArgs e)
        {
            if (tvClassView.SelectedNode == null)
            {
                return;
            }

            string  _SourceFile;
            string  _text = "";
            int     _Pos  = 0;
            ObjDecl _decl = e.Node.Tag as ObjDecl;

            if (_decl != null)
            {
                switch (_decl.ClassType())
                {
                case ObjDecl.TClassType.tCTSeq:
                    _text = _decl.ClassID() + " " + _decl.Function() + "\r\n" + _decl.Description();
                    break;

                case ObjDecl.TClassType.tCTClass:
                    _text = _decl.ClassID() + " " + _decl.Function() + "\r\n" + _decl.Description();
                    break;

                case ObjDecl.TClassType.tCTFunc:
                    _text  = _decl.ClassID() + " " + _decl.Function() + "\r\n";
                    _text += "(" + _decl.Params() + ")" + "->" + _decl.Returns() + "\r\n";
                    _text += "\r\n" + _decl.Description();
                    break;

                default:
                    break;
                }
                _SourceFile = _decl.ClassID();
                _Pos        = _decl.StartPos();
            }
            else
            {
                Obj _obj = tvClassView.SelectedNode.Tag as Obj;
                if (_obj != null)
                {
                    _text       = _obj.ClassID() + " " + _obj.Name() + "\r\n" + _obj.Scope();
                    _text      += "\r\n" + _obj.Description();
                    _SourceFile = _obj.Scope();
                    _Pos        = _obj.StartPos();
                }
                else
                {
                    return;
                }
            }
            textBox1.Text = _text;
        }
Exemple #2
0
            public int Compare(object x, object y)
            {
                TreeNode tx     = x as TreeNode;
                TreeNode ty     = y as TreeNode;
                ObjDecl  _decl1 = tx.Tag as ObjDecl;

                if (_decl1 != null)
                {
                }
                else
                {
                    Obj _obj1 = tx.Tag as Obj;
                    if (_obj1 != null)
                    {
                    }
                }
                return(string.Compare(tx.Text, ty.Text));
            }
Exemple #3
0
        /// <summary>
        /// 进入指定函数
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tvClassView_DoubleClick(object sender, EventArgs e)
        {
            if (tvClassView.SelectedNode == null)
            {
                return;
            }
            string  _SourceFile;
            int     _Pos = 0;
            string  _info;
            ObjDecl _decl = tvClassView.SelectedNode.Tag as ObjDecl;

            if (_decl != null)
            {
                _SourceFile = _decl.ClassID();
                _info       = _decl.Function();
                _Pos        = _decl.StartPos();
            }
            else
            {
                Obj _obj = tvClassView.SelectedNode.Tag as Obj;
                if (_obj != null)
                {
                    _SourceFile = _obj.Scope();
                    _info       = _obj.Name();
                    _Pos        = _obj.StartPos();
                }
                else
                {
                    return;
                }
            }

            String _path = Path.Combine(ProjectManager.GetProjectByItsFile(m_CurrFile).BaseDir, _SourceFile);

            if (File.Exists(_path))
            {
                Jump.Add(_info, _path, _Pos);
                Jump.Cursor.Go();
            }
        }