Fehler 1 Inkonsistenter accessibility: return type ist weniger zugreifbar als Methode

Wenn ich Baue, VS show error. Das ist mein code:

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
        return null;
}

Dies ist mein Fehler:

Fehler 1 Inkonsistenter accessibility: return type 'Project_HGHTM9.Composite' ist weniger zugreifbar als Methode " Project_HGHTM9.Form1.buildComposite(System.Windows.Formen.ComboBox System.Windows.Formen.ComboBox)' c:\users\nguyen\documents\visual studio 2013\Projects\Project_HGHTM9\Project_HGHTM9\Form1.cs 172 26 Project_HGHTM9

Ihre Composite Klasse sollte public sein. Gehen Sie voran und ändern
Die Fehlermeldung ist ziemlich selbsterklärend. Was bout es Sie nicht verstehen?
Sie nicht mehr zurück können, eine Art von einer öffentlichen Methode, die nicht öffentlich sich.

InformationsquelleAutor user3453838 | 2014-06-04

Schreibe einen Kommentar