Exemplo n.º 1
0
        public AssemblyConstructor(AssemblyImporter importer, Uml2.Class umlType,
			ConstructorInfo constructor)
            : base(importer, umlType)
        {
            _ctorInfo = constructor;
            Begin ();
        }
Exemplo n.º 2
0
 public AssemblyType(AssemblyImporter importer, System.Type systemType)
     : base(importer, systemType)
 {
     _lastPkg = null;
     IsNested ();
     StartPackaging ();
     LookForMe ();
 }
Exemplo n.º 3
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;
 }
Exemplo n.º 4
0
        public Wizard()
            : base(GettextCatalog.GetString ("Reverse Engineering"))
        {
            _druid = new Gnome.Druid ();
            _start = new DruidPageEdge (Gnome.EdgePosition.Start);
            _finish = new DruidPageEdge (Gnome.EdgePosition.Finish);
            _pImportingLevel = new DruidPageStandard ();
            _pImportingLevelAccess = new DruidPageStandard ();
            _pImportingParameters = new DruidPageStandard ();
            _pAssemblies = new DruidPageStandard ();
            _assemblyImporter = new AssemblyImporter ();
            _importingLevel = AssemblyImporterLevel.AssemblyImport;

            _start.Title = GettextCatalog.GetString ("Reverse Engineering");
            _start.Text = GettextCatalog.GetString ("In the following pages you will be able to import .NET assemblies and then build its UML model.\n\nClick Forward to continue");

            _finish.Title = GettextCatalog.GetString ("Start reverse engineering");
            _finish.Text = GettextCatalog.GetString ("Click Apply to proceed the reverse engineering, when finished a dialog window will pop up.");
            _finish.FinishClicked += OnReverseEngineering;

            CreateAssemblies ();
            CreateImportingLevel ();
            CreateImportingParameters ();
            CreateImportingLevelAccess ();

            _druid.AppendPage (_start);
            _druid.AppendPage (_pAssemblies);
            _druid.AppendPage (_pImportingLevel);
            _druid.AppendPage (_pImportingParameters);
            _druid.AppendPage (_pImportingLevelAccess);
            _druid.AppendPage (_finish);
            _druid.Cancel += OnCancel;

            Add (_druid);

            SetDefaultSize (530, 295);
            Modal = true;
            WindowPosition = Gtk.WindowPosition.CenterAlways;
            Icon = PixbufLoader.GetIcon ("main_icon.png");
            ShowAll ();
            Resize (1, 1);
        }
Exemplo n.º 5
0
 public AssemblyField(AssemblyImporter importer, FieldInfo field)
 {
     _importer = importer;
     _fieldInfo = field;
     Begin ();
 }
Exemplo n.º 6
0
 public AssemblyEnumeration(AssemblyImporter importer, System.Type systemType)
     : base(importer, systemType)
 {
 }
Exemplo n.º 7
0
 public AssemblyObject(AssemblyImporter importer, Type systemType)
 {
     _systemType = systemType;
     _importer = importer;
     _name = _systemType.Name;
 }
Exemplo n.º 8
0
 public static System.Type SearchWithinAssemblies(AssemblyImporter importer, string fName)
 {
     System.Type newType = null;
     foreach (System.Reflection.Assembly assmb in importer.Assemblies) //Looping in all the imported assemblies
     {
         newType = assmb.GetType (fName);
         if (newType != null)
         {
             break;
         }
     }
     if (newType == null) //Searching in mscorlib.dll
     {
         if (importer.ImportingLevel == AssemblyImporterLevel.FullImport)
         {
             newType = System.Type.GetType (fName); //MUST BE FOUND HERE!
         }
     }
     return newType;
 }
Exemplo n.º 9
0
        public AssemblyDataStructure(AssemblyDataStructureType dType, 
			AssemblyImporter importer, System.Type systemType)
            : base(importer, systemType)
        {
            _dType = dType;
        }
Exemplo n.º 10
0
 public AssemblyOperation(AssemblyImporter importer, Uml2.Type umlType)
 {
     _importer = importer;
     _umlType = umlType;
 }
Exemplo n.º 11
0
 public AssemblyMethod(AssemblyImporter importer, Uml2.Type umlType, MethodInfo method)
     : base(importer, umlType)
 {
     _methodInfo = method;
     Begin ();
 }
Exemplo n.º 12
0
 public AssemblyStruct(AssemblyImporter importer, System.Type type)
     : base(AssemblyDataStructureType.Struct, importer, type)
 {
 }
Exemplo n.º 13
0
 public AssemblyInterface(AssemblyImporter importer, System.Type systemType)
     : base(importer, systemType)
 {
 }
Exemplo n.º 14
0
 public AssemblyDataType(AssemblyImporter importer, System.Type sType)
     : base(AssemblyDataStructureType.DataType, importer, sType)
 {
 }
Exemplo n.º 15
0
 public AssemblyClass(AssemblyImporter importer, System.Type sType)
     : base(AssemblyDataStructureType.Class, importer, sType)
 {
 }
Exemplo n.º 16
0
        public static void SetParameter(object umlType, System.Type systemType, AssemblyImporter importer)
        {
            while (systemType.HasElementType)//Removing &, *, and []
            {
                if (systemType.IsByRef || systemType.IsPointer)
                {
                    Uml2.Parameter parameter = umlType as Uml2.Parameter;
                    if  (parameter != null)
                    {
                        parameter.Direction = ExpertCoder.Uml2.ParameterDirectionKind.inout;
                    }
                }
                if (systemType.IsArray)
                {
                    Uml2.MultiplicityElement array = umlType as Uml2.MultiplicityElement;
                    if (array != null)
                    {
                        array.Lower = 0;
                        array.Upper = Uml2.UnlimitedNatural.Infinity;
                    }
                }
                systemType = systemType.GetElementType ();
            }

            AssemblyType assemblyType = AssemblyHelper.CreateAssemblyType (importer, systemType);

            Uml2.TypedElement umlTyped = umlType as Uml2.TypedElement;
            if (umlTyped != null && assemblyType != null)
            {
                umlTyped.Type = assemblyType.UmlType;
            }
        }
Exemplo n.º 17
0
 public AssemblyPackage(AssemblyImporter importer, System.Type systemType)
 {
     _importer = importer;
     _systemType = systemType;
     _namespace = systemType.Namespace;
 }
Exemplo n.º 18
0
            public ProgressWindow(AssemblyImporter  importer, Thread thread)
                : base(GettextCatalog.GetString ("Importing..."))
            {
                _thread = thread;
                _importer = importer;
                _progress = new ProgressBar ();
                _progress.Orientation = ProgressBarOrientation.LeftToRight;
                _progress.Pulse ();

                Button cancel = new Button ();
                cancel.UseStock = true;
                cancel.Label = Gtk.Stock.Cancel;
                cancel.Clicked += CancelImporting;

                HButtonBox buttonBox = new HButtonBox ();
                buttonBox.PackStart (cancel, false, false, 0);

                VBox vbox = new VBox ();
                _message = new Label (GettextCatalog.GetString ("Please wait while loading..."));
                vbox.PackStart (_message, false, false, 0);
                vbox.PackEnd (buttonBox, false, false, 0);
                vbox.PackEnd (_progress, false, false, 0);

                _timer = GLib.Timeout.Add (100, new GLib.TimeoutHandler (ProgressTimeout));

                Add (vbox);

                Modal = true;
                HeightRequest = 70;
                WidthRequest = 180;
                WindowPosition = Gtk.WindowPosition.CenterAlways;
                Resizable = false;
                Icon = PixbufLoader.GetIcon ("main_icon.png");
                ShowAll ();
            }