当我建立时,VS显示错误.这是我的代码:
public Composite buildComposite(ComboBox subs, ComboBox bas)
{
int count = 0;
Composite a = new Composite();
if (subs.SelectedItem != null)
{
foreach (Substance d in listSubstance)
{
if (String.Compare(d.notation, subs.Text) == 0)
{
count++;
a.subs = new Substance(d);
break;
}
}
}
if (bas.SelectedItem != null)
{
foreach (Base g in listBase)
{
if (String.Compare(g.notation, bas.Text) == 0)
{
count++;
a.bas = new Base(g);
break;
}
}
}
if (count > 0)
{
a.equilibrium();
a.settypesubs(arrayDefinition);
return a;
}
else …Run Code Online (Sandbox Code Playgroud)