void SelectNextProject(bool backwards)
{
DataRow row = fileList.currentRow;
- DataRow currentRow = row;
- ProjectNode node = (ProjectNode)(intptr)row.tag;
- if(node.type != project)
- row = node.project.topNode.row;
- else if(backwards)
- row = row.previous ? row.previous : fileList.lastRow;
- if(!backwards)
- row = row.next ? row.next : fileList.firstRow;
- if(row && row != currentRow)
- {
- fileList.SelectRow(row);
- fileList.currentRow = row;
+ if(!row)
+ row = backwards ? fileList.lastRow : fileList.firstRow;
+
+ if(row)
+ {
+ DataRow currentRow = row;
+ ProjectNode node = (ProjectNode)(intptr)row.tag;
+ if(node.type != project)
+ row = node.project.topNode.row;
+ else if(backwards)
+ row = row.previous ? row.previous : fileList.lastRow;
+ if(!backwards)
+ row = row.next ? row.next : fileList.firstRow;
+ if(row && row != currentRow)
+ {
+ fileList.SelectRow(row);
+ fileList.currentRow = row;
+ }
}
}