本文整理汇总了C#中TreeModel.GetIterFirst方法的典型用法代码示例。如果您正苦于以下问题:C# TreeModel.GetIterFirst方法的具体用法?C# TreeModel.GetIterFirst怎么用?C# TreeModel.GetIterFirst使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TreeModel
的用法示例。
在下文中一共展示了TreeModel.GetIterFirst方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WalkStore
IEnumerable<TreeIter> WalkStore (TreeModel model)
{
TreeIter iter;
bool valid = model.GetIterFirst (out iter);
while (valid) {
yield return iter;
valid = model.IterNext (ref iter);
}
}
示例2: UpdateGameInModel
private static bool UpdateGameInModel(PGNChessGame
game,
PGNChessGame
replace,
TreeModel
model)
{
TreeIter iter;
bool ret;
for (ret = model.GetIterFirst (out iter); ret;
ret = model.IterNext (ref iter))
{
PGNChessGame g =
(PGNChessGame) model.
GetValue (iter, 0);
if (g.Equals (game))
{
model.SetValue (iter, 0,
replace);
return true;
}
}
return false;
}
示例3: IterPrev
//generally useful function... why not in model already?
private bool IterPrev(TreeModel model, ref TreeIter iter)
{
TreeIter prev, next;
if (!model.GetIterFirst (out prev))
return false;
do {
next = prev.Copy ();
if (!itemStore.IterNext (ref next))
return false;
//if next one on from prev is our iter
//then 'prev' is correct previous iter
if (next.Equals (iter)) {
iter = prev;
return true;
}
} while (itemStore.IterNext (ref prev));
return false;
}