protected override bool SelectFunction(TreeSelection selection, TreeModel model, TreePath path, bool selected) { TreePath [] selectedRows; selectedRows = selection.GetSelectedRows (); if (!selected && selectedRows.Length > 0) { object currentSelected; object firstSelected; firstSelected = GetValueFromPath (selectedRows [0]); // No multiple selection for players if (selectedRows.Length == 1 && firstSelected is Player) { return false; } currentSelected = GetValueFromPath (path); if (currentSelected is Player) { return false; } return true; } // Always unselect return true; }
protected override bool SelectFunction(TreeSelection selection, TreeModel model, TreePath path, bool selected) { // Don't allow multiselection for Players if(!selected && selection.GetSelectedRows().Length > 0) { if(selection.GetSelectedRows().Length == 1 && GetValueFromPath(selection.GetSelectedRows()[0]) is Player) return false; return !(GetValueFromPath(path) is Player); } // Always unselect else return true; }
protected override bool SelectFunction(TreeSelection selection, TreeModel model, TreePath path, bool selected) { TreePath[] selectedRows; selectedRows = selection.GetSelectedRows (); if (!selected && selectedRows.Length > 0) { object currentSelected; object firstSelected; firstSelected = GetValueFromPath (selectedRows [0]); // No multiple selection for event types and substitution events if (selectedRows.Length == 1) { if (firstSelected is EventType) { return false; } else if (firstSelected is StatEvent) { return false; } } currentSelected = GetValueFromPath (path); if (currentSelected is EventType || currentSelected is StatEvent) { return false; } return true; } // Always unselect return true; }