Menu

#1 error found in class:NGenerator.ClassForm

open
nobody
None
5
2004-12-16
2004-12-16
gaoshan
No

I'm a Chinese, and I'm very interested in this project.
But my english is very pool. So please don't laugh at my
word.

When I create a new class ,and add a new method, in
mainform I doubleclick the method name in the classform
and edit it. But I click the "Cancle" button,a error appear:

type:System.ArgumentOutOfRangeException
line : 238 (ClassForm.cs)

I find reason.
source code:
if (membersListView.SelectedItems.Count >= 1)
{
if (membersListView.SelectedItems[0].Tag is Method)
{
(some code...)
RefreshClass();// <----this method call a
items.clear() method on membersListView, so the
SelectedItems[0] property in next line will throw the
exception.
}

if (membersListView.SelectedItems[0].Tag is Property)
{
(some code...)
RefreshClass();
}
}

I modify code like this:
if (membersListView.SelectedItems[0].Tag is Method)
{
(some code...)
}
else if (membersListView.SelectedItems[0].Tag is
Property)
{
(some code...)
}
RefreshClass();

I just see at ClassEditForm.cs(427) don't have this error.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB