本文整理汇总了C#中TreeModel.IterChildren方法的典型用法代码示例。如果您正苦于以下问题:C# TreeModel.IterChildren方法的具体用法?C# TreeModel.IterChildren怎么用?C# TreeModel.IterChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TreeModel
的用法示例。
在下文中一共展示了TreeModel.IterChildren方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EventsListFromPaths
/// <summary>
/// Fill a list of events from a list of paths, if the first and unique path is an EventType the list
/// is filled with al the child events in this EventType category.
/// </summary>
/// <param name = "model">Model.</param>
/// <param name="events">Events.</param>
/// <param name="paths">Paths.</param>
public static List<TimelineEventLongoMatch> EventsListFromPaths(TreeModel model, TreePath[] paths)
{
List<TimelineEventLongoMatch> events = new List<TimelineEventLongoMatch> ();
// If it's an EventType or a Player, traverse all children to fill the list
if (paths.Length == 1 && !(model.GetValue (paths [0]) is TimelineEventLongoMatch)) {
TreeIter parentIter;
TreeIter child;
bool hasChild;
model.GetIter (out parentIter, paths [0]);
hasChild = model.IterHasChild (parentIter);
model.IterChildren (out child, parentIter);
while (hasChild) {
TimelineEventLongoMatch evt = model.GetValue (child, 0) as TimelineEventLongoMatch;
if (evt != null) {
events.Add (evt);
}
hasChild = model.IterNext (ref child);
}
} else {
foreach (var path in paths) {
TimelineEventLongoMatch evt = model.GetValue (path) as TimelineEventLongoMatch;
if (evt != null) {
events.Add (evt);
}
}
}
return events;
}
示例2: Copy
public static void Copy(TreeModel tree, ListStore list)
{
list.Clear();
TreeIter tree_iter;
if (tree.IterChildren(out tree_iter)) {
Copy(tree, tree_iter, list, true);
}
}
示例3: DoesSiblingLocationNeedToBeDisplayed
private bool DoesSiblingLocationNeedToBeDisplayed(TreeModel model, TreeIter node, string key){
bool retVal = false;
do {
if((model.GetValue(node,0) as Location).Item.MatchesKey(key)){
retVal = true;
break;
}
else {
TreeIter child;
if(model.IterChildren(out child,node)){
if(DoesSiblingLocationNeedToBeDisplayed(model,child,key) == true){
retVal = true;
break;
}
}
}
} while(model.IterNext(ref node));
return retVal;
}
示例4: FilterLocations
private bool FilterLocations (TreeModel model, Gtk.TreeIter iter)
{
// this function doesn't pass the filter but the actual model used
/* FIXME:
* If locationView is filtered down so that no item is displayed anymore, the following pops up
*
* (MyInventory:11584): Gtk-CRITICAL **: gtk_tree_model_row_has_child_toggled: assertion `path != NULL' failed
*
* There is an article about this message, saying that it isn't a problem
* http://archives.seul.org/geda/user/Jan-2009/msg00072.html
*/
Location loc = (model.GetValue(iter,0) as Location);
if(loc == null) return false;
Model.Item item = loc.Item;
if(item == null) return false;
// now we got the item, let's check if we need to display it
string key = locationsViewFilter.Text;
if( item.MatchesKey(key) == true){
return true;
}
else { // if it doesn't match we also need to show it if one of it's children matches
TreeIter child;
if(model.IterChildren(out child,iter)){
return DoesSiblingLocationNeedToBeDisplayed(model,child, key);
}
else {
return false; // no children
}
}
}
示例5: Copy
public static void Copy(TreeModel tree, TreeIter tree_iter, ListStore list, bool first)
{
// Copy this iter's values to the list
TreeIter list_iter = list.Append();
for (int i = 0; i < list.NColumns; i++) {
list.SetValue(list_iter, i, tree.GetValue(tree_iter, i));
if (i == 1) {
//Console.WriteLine("Copying {0}", list.GetValue(list_iter, i));
}
}
// Copy the first child, which will trigger the copy if its siblings (and their children)
TreeIter child_iter;
if (tree.IterChildren(out child_iter, tree_iter)) {
Copy(tree, child_iter, list, true);
}
// Add siblings and their children if we are the first child, otherwise doing so would repeat
if (first) {
while (tree.IterNext(ref tree_iter)) {
Copy(tree, tree_iter, list, false);
}
}
}
示例6: ShowMarketGroupItems
void ShowMarketGroupItems(TreeModel model, TreeIter iter)
{
// Clear the VBox
while (vbbMarketGroups.Children.Length > 0)
{
vbbMarketGroups.Remove(vbbMarketGroups.Children[0]);
}
TreeIter childIter;
// get children iterator
if (model.IterChildren(out childIter, iter))
{
do
{
long ID = Convert.ToInt64(model.GetValue(childIter, 2));
ECM.EveItem item = ECM.ItemDatabase.Items[ID];
AddItemToCurrentMarketGroup(item, model, childIter);
}
while (model.IterNext(ref childIter));
ntbMarketDetails.CurrentPage = 1;
}
}