Пример #1
0
 // 3. Pass type and add custom fields, ignore unattributed properties
 private static void Three()
 {
     ConzapTools.PrintObjects(fruit)
     .CustomField("Custom field 1", f => "The default descriptiuon is " + f.Description)
     .Configure(ObjectPrinterOptions.IgnoreUnattributedProperties)
     .Print();
 }
Пример #2
0
 public void ListFruit()
 {
     ConzapTools.ClearScreen();
     ConzapTools.PrintObjects(Fruits)
     .Configure(ObjectPrinterOptions.UseOnlyCustomFields)
     .ItemHeadingFactory(f => f.Type)
     .Print();
 }
Пример #3
0
 // 4. Pass type but ignore certain properties
 private static void Four()
 {
     ConzapTools.PrintObjects(fruit)
     .IgnoreProperty(f => f.Type)
     .IgnoreProperty(f => f.Description)
     .IgnoreProperty(f => f.Id)
     .IgnoreProperty(f => f.ContainsKernels)
     .Print();
 }
Пример #4
0
 // 2. Pass type and configure to ignore non attributed properties as well as ignore attributes
 private static void Two()
 {
     ConzapTools.PrintObjects(fruit)
     .Configure(ObjectPrinterOptions.IgnoreUnattributedProperties | ObjectPrinterOptions.IgnoreAttributes)
     .Print();
 }
Пример #5
0
 // 1. Pass type but no field information
 private static void ObjectPrinting1()
 {
     ConzapTools.ClearScreen();
     ConzapTools.PrintObjects(fruit).Print();
 }