Outputting a C# Object list -


i have

list<dynamic> events = new list<dynamic>();  (int = 0; < 3000; i++) {     if (i % 2 == 0) //is     {         var datastart = new         {             timeid = starttime.addseconds(i),             valuestart =         };     } } 

how can output in list object? new c# have tried

for (int j = 0; j < events.count; j++) {     console.writeline(events); } 

but not working. ideas need correctly output values of object?

first, add created items list:

list<dynamic> events = new list<dynamic>();  (int = 0; < 3000; i++)   if (i % 2 == 0) {//is     events.add( // <- not forget add       new {         timeid = starttime.addseconds(i),         valuestart = }     ); 

then print list out

foreach(var item in events)   if (!object.referenceequals(null, item))     console.writeline("time: {0} value: {1}", item.timeid, item.valuestart); 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -