uf @Class kann aufgrund der Schutzstufe nicht zugegriffen werden
Ich habe drei Klassen. Alle sind Teil desselben Namespaces. Hier sind die Grundlagen der drei Klassen.
//FBlock.cs
namespace StubGenerator.PropGenerator
{
class FBlock : IDesignRegionInserts, IFormRegionInserts, IAPIRegionInserts, IConfigurationInserts, ISoapProxyClientInserts, ISoapProxyServiceInserts
{
private List<Property> pProperties;
private List<Method> pMethods;
public FBlock(string aFBlockName)
{
pProperties = new List<Property>();
pMethods = new List<Method>();
}
public Property AddProperty(string aName)
{
Property loProp = new Property(this, aName, pProperties.Count);
pProperties.Add(loProp);
return loProp;
}
public Method AddMethod(string aName)
{
Method loMeth = new Method(this, aName);
pMethods.Add(loMeth);
return loMeth;
}
}
//Method.cs
namespace StubGenerator.PropGenerator
{
class Method : IPropertyName
{
private List<StubGenerator.PropGenerator.PropertyAttribute> pPropertyAttributes;
private string pName;
private string pFBlockName;
public Method(FBlock aFBlock,string aName)
{
pPropertyAttributes = new List<PropertyAttribute>();
pName = aName;
pFBlockName = aFBlock.Name;
}
}
}
//Property.cs
namespace StubGenerator.PropGenerator
{
class Property : StubGenerator.PropGenerator.IPropertyName, StubGenerator.PropGenerator.IDesignRegionInserts, StubGenerator.PropGenerator.IFormRegionInserts, IAPIRegionInserts, IConfigurationInserts, ISoapProxyClientInserts, ISoapProxyServiceInserts
{
private string pName;
private string pExpandedName;
private string pFBlockInitials;
private Group pPropertyGroup;
private FlowLayoutPanel pGroupFlowPanel;
private Button pUpdateButton;
private CheckBox pShowProperty;
private string pFBlockName;
public Property(FBlock aFBlock, string aName, int aIndex)
{
pPropertyAttributes = new List<PropertyAttribute>();
pFBlockName = aFBlock.FBlockName;
ExpandName();
GetInitials();
pShowProperty = new CheckBox(this, 10, (aIndex + 1) * 20, aIndex);
pPropertyGroup = new Group(this);
pGroupFlowPanel = new FlowLayoutPanel(this);
pUpdateButton = new Button(this, 10, 18, aIndex);
}
}
}
Ich erhalte die folgenden Fehlermeldungen
'StubGenerator.PropGenerator.Method' ist aufgrund der Schutzstufe nicht zugänglich
was auf die folgende Zeile in der FBlock.cs-Datei verweist
private List<Method> pMethods;
un
'StubGenerator.PropGenerator.Method' ist aufgrund der Schutzstufe nicht zugänglich
was auf die folgende Zeile in der FBlock.cs-Datei verweist
public Method AddMethod(string aName)
un
Inkonsistente Barrierefreiheit: Rückgabetyp 'StubGenerator.PropGenerator.Method' ist weniger zugänglich als Methode 'StubGenerator.PropGenerator.FBlock.AddMethod (string)'
was auf die folgende Zeile in der FBlock.cs-Datei verweist
public Method AddMethod(string aName)
making the class Die Methode public behebt die Fehler nicht. Ich kann nicht herausfinden, warum die Fehler beim Aufrufen der Property-Klasse nicht angezeigt werden. Und ich verstehe nicht, warum das Problem nicht behoben werden kann, wenn die Method-Klasse öffentlich gemacht wird.
Irgendwelche Ideen
Edited zu fragen. Könnte es eine Einstellung in der Datei geben, die dies verursacht?