void HandleSelectionDidChange(object sender, EventArgs e)
{
using (var a = new NSAutoreleasePool()) {
BeginInvokeOnMainThread(delegate {
if (TableView.SelectedRowCount > 0)
{
TableRowMenuOpen.Enabled = false;
foreach (int row in TableView.SelectedRows)
{
var item = DataSource.GetTransmissionItem(row);
if (item != null && item.Done)
{
TableRowMenuOpen.Enabled = true;
break;
}
}
TableView.Menu = TableRowContextMenu;
}
else
{
TableView.Menu = new NSMenu();
}
});
};
}