Esempio n. 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);
     }
 }
Esempio n. 2
0
 public void WriteToken(FmtToken token, WriteConfig config, string name)
 {
     token.WriteTo(this, config);
 }