コード例 #1
0
 private void PrintProperty(PropertyRecord p, string format1, string format2)
 {
     if (_typefmt == TypeFormat.NONE)
     {
         Console.WriteLine(format1, p.Name);
     }
     else if (_typefmt == TypeFormat.FULL)
     {
         Console.WriteLine(format2, p.Name, p.Type);
     }
     else
     {
         Console.WriteLine(format2, p.Name, TypeString.Symplify(p.Type));
     }
 }
コード例 #2
0
 private string FormatSuperClassName(string format, ClassRecord cr)
 {
     if (verboseLevel > 1)
     {
         var sb = new StringBuilder();
         sb.Append(TypeString.Symplify(cr.SuperClassFullName));
         bool found;
         do
         {
             found = false;
             foreach (var packageName in db.PackageNames)
             {
                 try
                 {
                     var cr2 = db.SelectByPackageName(packageName).Single((cr1) => cr1.FullName == cr.SuperClassFullName);
                     if (cr2 != null)
                     {
                         cr = cr2;
                         sb.Append(" : ");
                         sb.Append(TypeString.Symplify(cr.SuperClassFullName));
                         found = true;
                         break;
                     }
                 }
                 catch (Exception)
                 {
                 }
             }
         }while (found);
         return(string.Format(format, sb.ToString()));
     }
     else if (verboseLevel == 1)
     {
         return(string.Format(format, TypeString.Symplify(cr.SuperClassFullName)));
     }
     else
     {
         return(string.Empty);
     }
 }
コード例 #3
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);
             }
         }
     }
 }