public override void print(IDocumentGenerator dg, int sectionLevel)
 {
     dg.BeginReference(Url, true);
     try
     {
         foreach (var command in Commands)
         {
             command.print(dg, sectionLevel);
         }
     }
     finally
     {
         dg.EndReference();
     }
 }
 public override void print(IDocumentGenerator dg, int sectionLevel)
 {
     if (Compound != null || Member != null || referenceID != null)
     {
         switch (RefKind)
         {
             case DocRefKind.Compound:
                 dg.BeginReference(Compound.Identifier, false);
                 break;
             case DocRefKind.Member:
                 dg.BeginReference(Member.Identifier, false);
                 break;
             case DocRefKind.CustomID:
                 dg.BeginReference(referenceID, true);
                 break;
             default:
                 Console.WriteLine("WARNING: unsupported reference kind: " + RefKind);
                 break;
         }
     }
     try
     {
         if (Commands.Count > 0)
         {
             foreach (var command in Commands)
             {
                 command.print(dg, sectionLevel);
             }
         }
         else if (Compound != null || Member != null)
         {
             string name = null;
             switch (RefKind)
             {
                 case DocRefKind.Compound:
                     name = Compound.Name;
                     break;
                 case DocRefKind.Member:
                     name = Member.Name;
                     break;
                 default:
                     Console.WriteLine("WARNING: unsupported reference kind: DocRefKind." + RefKind);
                     break;
             }
             if (name != null)
             {
                 name = NormalizeName(name);
             }
             new DocText() { TextKind = DocTextKind.Plain, Text = name }.print(dg, sectionLevel);
         }
     }
     finally
     {
         dg.EndReference();
     }
 }