예제 #1
0
            public void Run()
            {
                _typefmt             = ClassComparator.GetInstance().TypeFormat;
                _activitiesDeleted   = new List <ClassRecord>();
                _activitiesAdded     = new List <ClassRecord>();
                _activitiesModified  = new List <ClassRecord>();
                _propertiesDeleted   = new List <PropertyRecord>();
                _propertiesAdded     = new List <PropertyRecord>();
                _currentActivityName = null;
                _modified            = false;
                var db1 = new ClassDatabase();
                var db2 = new ClassDatabase();

                db1.ReadFromPackage(_filename1, Program.PrintError);
                db2.ReadFromPackage(_filename2, Program.PrintError);
                if (_filename3 != null)
                {
                    db2.ReadFromPackage(_filename3, Program.PrintError);
                }
                Program.errors += ClassComparator.GetInstance().Run(db1, db2, this);
                Console.WriteLine("");
                Console.WriteLine("SUMMARY:");
                Console.WriteLine("  ---: {0}", _filename1);
                Console.WriteLine("  +++: {0}", _filename2);
                if (_filename3 != null)
                {
                    Console.WriteLine("  +++: {0}", _filename3);
                }
                Console.WriteLine("  DELETED classes: {0}", _activitiesDeleted.Count);
                foreach (var a in _activitiesDeleted)
                {
                    Console.WriteLine("    {0}", a.Name);
                }
                Console.WriteLine("  ADDED classes: {0}", _activitiesAdded.Count);
                foreach (var a in _activitiesAdded)
                {
                    Console.WriteLine("    {0}", a.Name);
                }
                Console.WriteLine("  MODIFIED classes: {0}", _activitiesModified.Count);
                foreach (var a in _activitiesModified)
                {
                    Console.WriteLine("    {0}", a.Name);
                }
            }
예제 #2
0
 private void Print(ClassDatabase db)
 {
     foreach (var packageName in db.PackageNames)
     {
         Console.WriteLine("{0}", packageName);
         foreach (var c in db.SelectByPackageName(packageName))
         {
             if (c.IsPublic && !c.IsAbstract && c.IsActivity)
             {
                 Console.WriteLine("    {0}{1}", c.Name, FormatSuperClassName(" ({0})", c));
                 foreach (var property in c.Properties)
                 {
                     Console.WriteLine("        {0} ({1})", property.Name, TypeString.Symplify(property.Type));
                 }
             }
             else if (Program.debug)
             {
                 Console.WriteLine("# TYPE={0} IsPub={1} IsAbs={2} IsAct={3}", c.Name, c.IsPublic, c.IsAbstract, c.IsActivity);
             }
         }
     }
 }
예제 #3
0
 public ClassRecord(Mono.Cecil.TypeDefinition td, Mono.Cecil.ModuleDefinition md, ClassDatabase db)
 {
     _td = td;
     _md = md;
     _db = db;
 }