void get_children(UmlObject obj, ArrayList to) { if (obj is UmlProject) { obj = ((UmlProject)obj).root; } UmlTypeHolder from = obj as UmlTypeHolder; if (from == null) { return; } UmlNamespace ns = from as UmlNamespace; if (ns != null && ns.SubNamespaces != null) { foreach (UmlObject s in ns.SubNamespaces) { to.Add(s); } } foreach (UmlObject s in ((UmlTypeHolder)from).Types) { to.Add(s); } if (from is UmlClass) { UmlClass cl = (UmlClass)from; if (cl.Members != null) { foreach (UmlObject m in cl.Members) { to.Add(m); } } } }
private void LoadEnum( UmlTypeHolder scope, EnumDecl decl, UsingBlock usings ) { // get cl from old classes, or create a new one UmlEnum en = null; foreach( UmlType ent in scope.Types ) { if( ent.name.Equals( decl.name.identifier ) && ent is UmlEnum ) { en = (UmlEnum)ent; break; } } if( en == null ) { en = new UmlEnum(); scope.Types.Add( en ); added_classes.Add( en ); } // register class classes[en] = decl; // fill with information en.Deleted = false; en.name = decl.name.identifier; }
private void LoadDelegate( UmlTypeHolder scope, DelegateNode decl, UsingBlock usings ) { // get cl from old classes, or create a new one UmlDelegate deleg = null; foreach( UmlType ent in scope.Types ) { if( ent.name.Equals( decl.name.identifier ) && ent is UmlDelegate ) { deleg = (UmlDelegate)ent; break; } } if( deleg == null ) { deleg = new UmlDelegate(); scope.Types.Add( deleg ); added_classes.Add( deleg ); } // register class classes[deleg] = decl; // fill with information deleg.Deleted = false; deleg.name = decl.name.identifier; }
private void LoadClass( UmlTypeHolder scope, ClassDecl decl, UsingBlock usings ) { // get cl from old classes, or create a new one UmlClass cl = null; foreach( UmlType ent in scope.Types ) { if( ent.name.Equals( decl.name.identifier ) && ent is UmlClass ) { cl = (UmlClass)ent; break; } } if( cl == null ) { cl = new UmlClass(); scope.Types.Add( cl ); added_classes.Add( cl ); } // register class classes[cl] = decl; // fill with information switch( decl.kind ) { case Kind.Class: cl.kind = UmlKind.Class; break; case Kind.Interface: cl.kind = UmlKind.Interface; break; case Kind.Struct: cl.kind = UmlKind.Struct; break; } cl.name = decl.name.identifier; cl.using_chain = usings; cl.Deleted = false; cl.IsAbstract = ( decl.modifiers != null && (decl.modifiers.value & (int)Modifiers.Abstract) != 0 ); FillClassWithTypes( cl, decl ); }