A classe está inacessível devido ao seu nível de proteção
Eu tenho três aulas todos fazem parte do mesmo espaço para nome. Aqui estão os conceitos básicos das três classes.
//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);
}
}
}
Estou recebendo os seguintes erros
'StubGenerator.PropGenerator.Method' está inacessível devido ao seu nível de proteção
que se refere à seguinte linha no arquivo FBlock.cs
private List<Method> pMethods;
e
'StubGenerator.PropGenerator.Method' está inacessível devido ao seu nível de proteção
que se refere à seguinte linha no arquivo FBlock.cs
public Method AddMethod(string aName)
e
Acessibilidade inconsistente: o tipo de retorno 'StubGenerator.PropGenerator.Method' é menos acessível que o método 'StubGenerator.PropGenerator.FBlock.AddMethod (string)'
que se refere à seguinte linha no arquivo FBlock.cs
public Method AddMethod(string aName)
Tornar público o método de classe não resolve os erros. Não consigo descobrir por que não recebo os erros ao chamar a classe Property. E não entendo por que tornar pública a classe Method não resolve o problema.
Alguma ideia?
Editado para perguntar. poderia haver alguma configuração no arquivo que causa isso?