private bool FilterTree(Gtk.TreeModel model, Gtk.TreeIter iter) { if (!checkbuttonDisplayOnlySupported.Active) { return(true); } object value = model.GetValue(iter, 1); if (value is NotificationRegistry.NotificationRegistryEntry) { NotificationRegistry.NotificationRegistryEntry myclass = value as NotificationRegistry.NotificationRegistryEntry; return(myclass.IsSupported); } else { TreeIter citer; if (typeListStore.IterHasChild(iter)) { typeListStore.IterChildren(out citer, iter); do { NotificationRegistry.NotificationRegistryEntry childType = (NotificationRegistry.NotificationRegistryEntry)model.GetValue(citer, 1); if (childType != null && childType.IsSupported) { return(true); } }while (typeListStore.IterNext(ref citer)); } return(false); } }
protected void OnTreeviewNotificationsCursorChanged(object sender, EventArgs e) { TreeModel model; TreeIter iter; TreeSelection selection = (sender as TreeView).Selection; if (selection.GetSelected(out model, out iter)) { SelectedType = (NotificationRegistry.NotificationRegistryEntry)model.GetValue(iter, 1); } }
private void NameRenderer(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) { object value = model.GetValue(iter, 1); if (value is NotificationRegistry.NotificationRegistryEntry) { NotificationRegistry.NotificationRegistryEntry myclass = value as NotificationRegistry.NotificationRegistryEntry; if (myclass != null) { (cell as CellRendererText).Text = myclass.Name; } } else { (cell as CellRendererText).Text = (String)model.GetValue(iter, 0); } }