public ClassDeclarationViewModel(ClassDecl decl)
            :base(decl.Cursor)
        {
            _declaration = decl;
                        
            _constructorGroup = new SymbolGroupViewModel("Constructors");
            _methodGroup = new SymbolGroupViewModel("Methods");
            _memberGroup = new SymbolGroupViewModel("Data Members");
            _baseClassGroup = new SymbolGroupViewModel("Base Classes");

            foreach (var ctor in _declaration.Constructors)
            {
                _constructorGroup.AddSymbol(new ConstructorViewModel(ctor));
            }

            foreach (var method in from method in _declaration.Methods orderby method.Spelling select method)
            {
                _methodGroup.AddSymbol(new MethodDeclarationViewModel(method));
            }

            foreach (var b in _declaration.BaseClasses)
            {
                _baseClassGroup.AddSymbol(new ClassDeclarationViewModel(b));
            }

            foreach (var data in from member in _declaration.DataMembers orderby member.Spelling select member)
            {
                _memberGroup.AddSymbol(new DataMemberViewModel(data));
            }
        }
Beispiel #2
0
 public FieldDecl(Cursor c, ISymbolTable table)
     : base(c, table)
 {
     Debug.Assert(c.Kind == CursorKind.FieldDecl);
     _class = table.FindClassDeclaration(c.SemanticParentCurosr.Usr);
     Debug.Assert(_class != null);
 }
Beispiel #3
0
 public MethodDecl(Cursor declaration, ISymbolTable table)
     : base(declaration, table)
 {
     Debug.Assert(CursorKinds.IsClassStructEtc(declaration.SemanticParentCurosr.Kind));
     _class = table.FindClassDeclaration(declaration.SemanticParentCurosr.Usr);
     Debug.Assert(_class != null);            
 }
Beispiel #4
0
 public ConstructorDecl(Cursor c, ISymbolTable table)
     : base(c, table)
 {            
     Debug.Assert(c.Kind == CursorKind.Constructor);
     _class = table.FindClassDeclaration(c.SemanticParentCurosr.Usr);
     //could be classtemplate 
     //Debug.Assert(_class != null);
 }
Beispiel #5
0
        private DeclarationViewModel FindOrAddClassNode(ClassDecl c)
        {
            if(c.Parent == null)
            {
                DeclarationViewModel vm = FindRootLevelItem(c.Usr);
                if (vm != null)
                    return vm;

                vm = new DeclarationViewModel(null, c);
                _root.Add(vm);
                return vm;
            }
            Debug.Assert(c.Parent != null);
            var parentnode = FindOrAddParentNode(c.Parent);
            return parentnode.FindOrAddChildDecl(c);
        }
Beispiel #6
0
 public DestructorDecl(Cursor c, ISymbolTable table)
     : base(c, table)
 {
     Debug.Assert(c.Kind == CursorKind.Destructor);
     _class = table.FindClassDeclaration(c.SemanticParentCurosr.Usr);
 }