本文整理汇总了C#中TreeModel.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# TreeModel.SetValue方法的具体用法?C# TreeModel.SetValue怎么用?C# TreeModel.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TreeModel
的用法示例。
在下文中一共展示了TreeModel.SetValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateModelDefaultAccelerators
private bool UpdateModelDefaultAccelerators(TreeModel model, TreePath path, TreeIter treeiter)
{
var accelPath = (string)model.GetValue(treeiter, (int)Column.AccelPath);
if (!MyAccelMap.AccelMapChanges.Contains(accelPath))
{
return false;
}
Gtk.AccelKey accel = new Gtk.AccelKey();
if (MyAccelMap.LookupPendingEntry(accelPath, out accel))
{
string shortcut = Gtk.Accelerator.GetLabel((uint)accel.Key, accel.AccelMods);
model.SetValue(treeiter, (int)Column.AccelKey, (uint)accel.Key);
model.SetValue(treeiter, (int)Column.AccelMods, accel.AccelMods);
model.SetValue(treeiter, (int)Column.Shortcut, shortcut);
}
return false;
}
示例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: UpdateModelChangedAccelerators
private bool UpdateModelChangedAccelerators(TreeModel model, TreePath path, TreeIter treeiter, string newAccelPath, uint newAccelKey, Gdk.ModifierType newAccelMods)
{
var rowAccelPath = (string)model.GetValue(treeiter, (int)Column.AccelPath);
var rowAccelKey = (uint)model.GetValue(treeiter, (int)Column.AccelKey);
var rowAccelMods = (Gdk.ModifierType)model.GetValue(treeiter, (int)Column.AccelMods);
if (rowAccelPath == newAccelPath)
{
string shortcut = Gtk.Accelerator.GetLabel(newAccelKey, newAccelMods);
model.SetValue(treeiter, (int)Column.AccelKey, newAccelKey);
model.SetValue(treeiter, (int)Column.AccelMods, newAccelMods);
model.SetValue(treeiter, (int)Column.Shortcut, shortcut);
}
else
{
if (rowAccelKey == newAccelKey && rowAccelMods == newAccelMods)
{
model.SetValue(treeiter, (int)Column.AccelKey, null);
model.SetValue(treeiter, (int)Column.AccelMods, null);
model.SetValue(treeiter, (int)Column.Shortcut, null);
}
}
return false;
}