Esempio n. 1
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);
 }
Esempio n. 2
0
        public static GuiPackage fromUML(UmlNamespace st)
        {
            GuiPackage s = new GuiPackage();

            s.name = st.UniqueName;
            s.st   = st;
            s.Created();
            return(s);
        }
Esempio n. 3
0
        private bool Update()
        {
            Hashtable h = new Hashtable();

            foreach (Type t in assem.GetExportedTypes())
            {
                if (t.DeclaringType != null)
                {
                    continue;
                }
                UmlNamespace ns       = root;
                string       typename = t.FullName;
                int          lastdot  = typename.LastIndexOf('.');
                if (lastdot >= 0)
                {
                    string N = typename.Substring(0, lastdot);
                    typename = typename.Substring(lastdot + 1);
                    if (h.ContainsKey(N))
                    {
                        ns = (UmlNamespace)h[N];
                    }
                    else
                    {
                        h[N] = ns = EnsureNamespaceCreated(root, N);
                    }
                }
                if (typename.Length == 0)
                {
                    return(false);
                }
                if (ns.Types == null)
                {
                    ns.Types = new ArrayList();
                }
                UmlType found = UpdateTypeInArray(ns.Types, t, typename);
                if (!UpdateMembers(found, t))
                {
                    return(false);
                }
            }

            return(true);
        }
Esempio n. 4
0
        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);
                    }
                }
            }
        }
Esempio n. 5
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;
 }
Esempio n. 6
0
 public override void PostLoad()
 {
     st = source_dependant ? parent.proj.model.GetObject(name) as UmlNamespace : null;
     base.PostLoad();
 }