示例#1
0
 public static ImmutableArray <string> GetProperties <T>(T o)
 {
     if (o is ITraversableObject to)
     {
         return(to.Properties);
     }
     else if (o is System.Collections.IList collection)
     {
         if (collection.Count == 0)
         {
             return(ImmutableArray <string> .Empty);
         }
         else
         {
             return(FmtToken.IntegerTokenMap().Take(collection.Count).ToImmutableArray());
         }
     }
     else if (o is IReadOnlyList <object> roCollection)
     {
         if (roCollection.Count == 0)
         {
             return(ImmutableArray <string> .Empty);
         }
         else
         {
             return(FmtToken.IntegerTokenMap().Take(roCollection.Count).ToImmutableArray());
         }
     }
     else
     {
         return(ImmutableArray <string> .Empty);
     }
 }
示例#2
0
文件: FmtToken.cs 项目: exyi/coberec
 public void WriteToken(FmtToken token, WriteConfig config, string name)
 {
     token.WriteTo(this, config);
 }