本文整理汇总了C#中TreeModel.GetColumnType方法的典型用法代码示例。如果您正苦于以下问题:C# TreeModel.GetColumnType方法的具体用法?C# TreeModel.GetColumnType怎么用?C# TreeModel.GetColumnType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TreeModel
的用法示例。
在下文中一共展示了TreeModel.GetColumnType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TreeViewSearchFunc
// It seems if using own TreeViewSearchEqualFunc one cannot use default function anymore.
// Function getter returns null and null is not allowed.
// Workaround: define own functions for all needed column types.
// FALSE if the row does MATCH, otherwise true !!!
bool TreeViewSearchFunc(TreeModel model, int column, string key, TreeIter iter)
{
object content = model.GetValue (iter, column);
GLib.GType gt = model.GetColumnType (column);
if (gt == GLib.GType.Float)
return EqualFuncFloat (key, (float)content);
else if (gt == GLib.GType.String)
return EqualFuncString (key, (string)content);
// type int needs further info!
switch ((ColumnNr2D)column) {
case ColumnNr2D.Location:
case ColumnNr2D.XPos:
case ColumnNr2D.YPos:
return EqualFuncHex (key, (int)content);
case ColumnNr2D.Type:
return EqualFuncTableType (key, (Tables.TableType)content);
case ColumnNr2D.CountX:
return EqualFuncInt (key, (int)content);
default:
// cannot search on icon column, must signal true = no match.
return true;
}
}