コード例 #1
0
 public static AssemblyType CreateAssemblyType(AssemblyImporter importer, System.Type systemType)
 {
     AssemblyType assemblyType = null;
     if (systemType.IsEnum)
     {
         assemblyType = new AssemblyEnumeration (importer, systemType);
         assemblyType.Begin ();
     }
     else if (systemType.IsInterface)
     {
         assemblyType = new AssemblyInterface (importer, systemType);
         assemblyType.Begin ();
     }
     else if (systemType.IsClass)
     {
         assemblyType = new AssemblyClass (importer, systemType);
         assemblyType.Begin ();
     }
     else if (systemType.IsPrimitive)
     {
         assemblyType = new AssemblyDataType (importer, systemType);
         assemblyType.Begin ();
     }
     else if (systemType.IsValueType)
     {
         if (systemType.GetMembers (AssemblyHelper.BINDING_FLAGS).Length == 1)
         {
             assemblyType = new AssemblyDataType (importer, systemType);
             assemblyType.Begin ();
         }
         else
         {
             assemblyType = new AssemblyStruct (importer, systemType);
             assemblyType.Begin ();
         }
     }
     else
     {
         System.Console.WriteLine ("System.FullName: "+systemType.FullName+" sealed: "+systemType.IsSealed );
     }
     return assemblyType;
 }
コード例 #2
0
ファイル: AssemblyClass.cs プロジェクト: MonoBrasil/historico
 private void Loop()
 {
     bool doFullImport = AssemblyHelper.SearchWithinAssemblies (_importer, _systemType.FullName) != null;
     if (doFullImport) { GetConstructors (); }
     // even if we aren't doing a full import, we must create the complete inheritance chain;
     // in this case, these classes will be empty, only their base classes
     // and implemented interfaces will be represented.
     System.Type baseType = _systemType.BaseType;
     if (baseType != null)
     {
         if (!baseType.FullName.Equals ("System.Object")) //FIXME. is this all right!?
         {
             AssemblyClass assemblyClass = new AssemblyClass (_importer, baseType);
             assemblyClass.Begin ();
             Uml2.Generalization generalization = Uml2.Create.Generalization ();
             generalization.General = (Uml2.Class) assemblyClass.UmlType;
             ((Uml2.Class) _umlType).Generalization.Add (generalization);
         }
     }
 }
コード例 #3
0
 private void BeginWithType(System.Type type)
 {
     if (type.IsEnum)
     {
         if (Elements [type.FullName] == null && ImportEnumerations)
         {
             AssemblyEnumeration enm = new AssemblyEnumeration (this, type);
             enm.Begin ();
         }
     }
     else if (type.IsInterface)
     {
         if (Elements [type.FullName] == null && ImportInterfaces)
         {
             AssemblyInterface intrface = new AssemblyInterface (this, type);
             intrface.Begin ();
         }
     }
     else if (type.IsClass)
     {
         if (Elements [type.FullName] == null && ImportClasses)
         {
             AssemblyClass cls = new AssemblyClass (this, type);
             cls.Begin ();
         }
     }
     else if (type.IsPrimitive)
     {
         if (Elements [type.FullName] == null)
         {
             AssemblyDataType dataType = new AssemblyDataType (this, type);
             dataType.Begin ();
         }
     }
     else if (type.IsValueType)
     {
         if (Elements [type.FullName] == null)
         {
             if (type.GetMembers (AssemblyHelper.BINDING_FLAGS).Length == 1)
             {
                 AssemblyDataType dataType = new AssemblyDataType (this, type);
                 dataType.Begin ();
             }
             else if (ImportStructs)
             {
                 AssemblyStruct structure = new AssemblyStruct (this, type);
                 structure.Begin ();
             }
         }
     }
 }