Sunday, 15 August 2010

c# - How can i check if a List have been changed? -



c# - How can i check if a List<string> have been changed? -

i have list every x seconds update. want know each x seconds if new item/s have been added list , items.

for illustration have in list:

index 0 : test index 1 : number 1

then after x seconds new item have been added:

index 0 : test index 1 : number 1 index 2 : im new item

what want check new items can 1 item or 20 after x seconds , items should add together top of list. each time lastly item first. if 1 item added first if 20 items have been added item 20 first in list , item 1 of 20 @ number 20.

i asked before know more need.

and doing inser(0,...) not good.

newtext.add(t[i]); newtext.add(datetime[i]); newtext.add(string.empty);

if im doing newtext.insert(0,t[i]); dosent show later. if im using insert property won't build list wanted add together date&time of them in end , empty lines...

thats why didn't utilize insert.

edit

i forgot mention need maintain list format:

newtext.add(t[i]); newtext.add(datetime[i]); newtext.add(string.empty);

when mean lastly item mean lastly 3 indexs. each 3 indexs in list 1 group/block. list format this:

index 0 text: hello world index 1 date&time: 22/6/2014 index 2 space/empty line:

so when mean move lastly item top of list mean exmaple index 28 @ index 0 index 29 @ index 1 , index 30 @ index 2. since in index 28 have text index 29 date&time , index 30 empty line.

this how list like:

how using observablecollection<t>?

http://msdn.microsoft.com/library/ms668604(v=vs.110).aspx

with monitor list in real time.

what possible, monitoring collectionchanged event , collect in sec list, clear every 20 seconds

c# .net winforms

No comments:

Post a Comment