* ResourceListBox.cs: Don't crash on click if there are no

items selected.


svn path=/trunk/winforms-tools/; revision=51521
This commit is contained in:
Jackson Harper 2005-10-10 16:40:58 +00:00
Родитель b214328eab
Коммит eac6d12223
2 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -1,3 +1,8 @@
2005-10-10 Jackson Harper <jackson@ximian.com>
* ResourceListBox.cs: Don't crash on click if there are no
items selected.
2005-10-09 Alexander Olk <alex.olk@googlemail.com> 2005-10-09 Alexander Olk <alex.olk@googlemail.com>
* Makefile: Updated * Makefile: Updated

Просмотреть файл

@ -305,9 +305,10 @@ namespace MWFResourceEditor
protected override void OnClick( EventArgs e ) protected override void OnClick( EventArgs e )
{ {
if ( SelectedIndex != old_selected_index ) if ( SelectedIndex != -1 && SelectedIndex != old_selected_index )
{ {
old_selected_index = SelectedIndex; old_selected_index = SelectedIndex;
Console.WriteLine ("Selected Index: " + SelectedIndex);
resourceTreeView.ShowItem( Items[ SelectedIndex ] as IResource, showType ); resourceTreeView.ShowItem( Items[ SelectedIndex ] as IResource, showType );
} }
base.OnClick( e ); base.OnClick( e );