Beispiel #1
0
 public static GuiPackage fromUML( UmlNamespace st )
 {
     GuiPackage s = new GuiPackage();
     s.name = st.UniqueName;
     s.st = st;
     s.Created();
     return s;
 }
Beispiel #2
0
 private void FillNamespace( UmlNamespace curr, NamespaceDecl nsnode, UsingBlock usings )
 {
     if( nsnode != null && nsnode.members != null ) {
         usings = create_Usings( nsnode, usings, curr );
         foreach( Node n in nsnode.members.nodes ) {
             switch( n.kind ) {
                 case Kind.Interface:
                 case Kind.Struct:
                 case Kind.Class:
                     LoadClass( curr, (ClassDecl)n, usings );
                     break;
                 case Kind.Delegate:
                     LoadDelegate( curr, (DelegateNode)n, usings );
                     break;
                 case Kind.Enum:
                     LoadEnum( curr, (EnumDecl)n, usings );
                     break;
                 case Kind.Namespace:
                     NamespaceDecl nsdecl = (NamespaceDecl)n;
                     FillNamespace( EnsureNamespaceCreated( curr, nsdecl.name.identifier ), nsdecl, usings );
                     break;
             }
         }
     }
 }
Beispiel #3
0
 private UmlNamespace EnsureNamespaceCreated( UmlNamespace curr, string newname )
 {
     foreach( string name in newname.Split( new char[]{ '.' } ) ) {
         curr.Deleted = false;
         if( curr.SubNamespaces != null )
             foreach( UmlNamespace child in curr.SubNamespaces )
                 if( child.name.Equals( name ) ) {
                     curr = child;
                     goto found;
                 }
         if( curr.SubNamespaces == null )
             curr.SubNamespaces = new ArrayList();
         UmlNamespace newns = new UmlNamespace();
         curr.SubNamespaces.Add( newns );
         curr = newns;
         curr.name = name;
         found:;
     }
     curr.Deleted = false;
     return curr;
 }
Beispiel #4
0
 private UsingBlock create_Usings( NamespaceDecl node, UsingBlock prev, UmlNamespace assoc_with )
 {
     if( node.usings != null && node.usings.nodes.Count > 0 ) {
         UsingBlock newblock = new UsingBlock();
         newblock.parent = prev;
         newblock.list = new ArrayList();
         newblock.aliases = new Hashtable();
         newblock.related = assoc_with;
         foreach( UsingNode un in node.usings.nodes ) {
             if( un.alias_id != null )
                 newblock.aliases[un.alias_id.identifier] = un.type_name.identifier;
             else
                 newblock.list.Add( un.type_name.identifier );
         }
         return newblock;
     }
     return prev;
 }
Beispiel #5
0
 void CollectDeleted( UmlNamespace scope )
 {
     if( scope.Types != null )
         FilterDeleted( ref scope.Types );
     if( scope.SubNamespaces != null )
         FilterDeleted( ref scope.SubNamespaces );
 }
Beispiel #6
0
 public override void PostLoad()
 {
     st = source_dependant ? parent.proj.model.GetObject( name ) as UmlNamespace : null;
     base.PostLoad ();
 }