本文整理汇总了C#中TreeModel.IterHasChild方法的典型用法代码示例。如果您正苦于以下问题:C# TreeModel.IterHasChild方法的具体用法?C# TreeModel.IterHasChild怎么用?C# TreeModel.IterHasChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TreeModel
的用法示例。
在下文中一共展示了TreeModel.IterHasChild方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: RenderIcon
void RenderIcon (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter)
{
var pixbufCellRenderer = (CellRendererPixbuf)cell;
if (model.IterHasChild (iter)) {
pixbufCellRenderer.Pixbuf = ImageService.GetPixbuf (((TreeView)col.TreeView).GetRowExpanded (model.GetPath (iter)) ? MonoDevelop.Ide.Gui.Stock.OpenFolder : MonoDevelop.Ide.Gui.Stock.ClosedFolder, IconSize.Menu);
} else {
pixbufCellRenderer.Pixbuf = ImageService.GetPixbuf (MonoDevelop.Ide.Gui.Stock.Property, IconSize.Menu);
}
}
示例3: IsCapitalSensitive
public static void IsCapitalSensitive(CellLayout cellLayout, CellRenderer cell, TreeModel treeModel, TreeIter iter)
{
cell.Sensitive = !treeModel.IterHasChild (iter);
}