Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个TreeStore,我想在一个循环中遍历它的值并将一些值与某些值进行比较。
TreeStore
我怎样才能做到这一点?
我尝试了一个简单的循环,例如
TreeIter iter = new TreeIter(); if (Values.GetIterFirst(out iter)) { while (Values.IterNext(ref iter)) { // do something } }
但这不起作用
我发现该Foreach功能可以做到这一点:
Foreach
private bool feIter(TreeModel model, TreePath path, TreeIter iter) { if (Values.GetValue(iter, 1) == ObjectStore) { return true; // exit loop } return false; // continue in loop } public void Blah() { Values.Foreach(feIter); }