Work around mono crashing on Rows.Clear()

Mono will crash if you do a Rows.Clear() and the first row isnt visible.  To
work around this, when running under mono force scroll to [0,0] cell before
issuing the Clear().

https://bugzilla.xamarin.com/show_bug.cgi?id=24372

Renamed Settings.MonoFileIO to Settings.IsUnix
Created Settings.IsMono
This commit is contained in:
Jim Westfall
2014-11-13 17:24:53 -08:00
parent 09ccdd7e10
commit b54610c2f6
5 changed files with 46 additions and 20 deletions

View File

@@ -444,6 +444,15 @@ namespace ROMVault2
private void DatSetSelected(RvBase cf)
{
DirTree.Refresh();
if (Settings.IsMono)
{
if (GameGrid.RowCount > 0)
GameGrid.CurrentCell = GameGrid[0,0];
if (RomGrid.RowCount > 0)
RomGrid.CurrentCell = RomGrid[0,0];
}
GameGrid.Rows.Clear();
RomGrid.Rows.Clear();
@@ -579,6 +588,15 @@ namespace ROMVault2
lblDITRomsUnknown.Text = (tDir.DirStatus.CountUnknown() + tDir.DirStatus.CountInToSort()).ToString(CultureInfo.InvariantCulture);
_updatingGameGrid = true;
if (Settings.IsMono)
{
if (GameGrid.RowCount > 0)
GameGrid.CurrentCell = GameGrid[0,0];
if (RomGrid.RowCount > 0)
RomGrid.CurrentCell = RomGrid[0,0];
}
GameGrid.Rows.Clear();
RomGrid.Rows.Clear();
@@ -1160,6 +1178,9 @@ namespace ROMVault2
}
}
if (Settings.IsMono && RomGrid.RowCount > 0)
RomGrid.CurrentCell = RomGrid[0,0];
RomGrid.Rows.Clear();
AddDir(tGame, "");
GC.Collect();