在vb.net LIFO或FIFO中列出,为什么? [英] List in vb.net LIFO or FIFO and why?

查看:90
本文介绍了在vb.net LIFO或FIFO中列出,为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有此列表(只是一个典型的.net列表),我在其中添加了一堆UI项,然后将该列表作为Sub的一部分,该Sub通过.getenumarator和While循环进行遍历.

I have this list (Just a typical .net list) and im adding a bunch of UI Items into it, the list is then taken for a Sub which goes through it with .getenumarator and While loop.

现在的问题是如何从该列表中检索我的物品?

Now the question is how are my items retrived from this list ???

是先进先出或后进先出或答案不在上述范围内,而我完全失去了它!在这种情况下,也许我需要其他信息或更多其他信息.

is that First in First out OR Last in First out OR the answer is non of above and ive totaly lost it !! in which case perhaps I need different or more info on something else.

请帮忙....

谢谢

推荐答案

List的Enumerator将按照添加顺序对元素进行遍历.因此,如果使用.Add或.AddRange添加元素,则为"FIFO".但是,当然也可以使用插入"将元素插入列表"中的任何位置.

The Enumerator for List will go through the elements in the order they were added. So "FIFO" in case elements are added using .Add or .AddRange. But elements can of course also be inserted anywhere in the List using Insert.

请参见以获取更多证明". (这不是官方的!)

See this similar question for more 'proof'. (It's not official!)

这篇关于在vb.net LIFO或FIFO中列出,为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆