Klasse unzugänglich ist aufgrund seiner Schutzstufe

Habe ich drei Klassen. Sie alle gehören zum gleichen Namensraum. 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);
         }
     }
}

Bin ich immer die folgenden Fehler

'StubGenerator.PropGenerator.Die Methode' unzugänglich ist aufgrund seiner Schutzstufe

bezieht sich auf folgende Zeile in der FBlock.cs-Datei

private List<Method> pMethods;

und

'StubGenerator.PropGenerator.Die Methode' unzugänglich ist aufgrund seiner Schutzstufe

bezieht sich auf folgende Zeile in der FBlock.cs-Datei

 public Method AddMethod(string aName)

und

Inkonsistent accessibility: return type 'StubGenerator.PropGenerator.Methode' ist weniger zugreifbar als Methode " StubGenerator.PropGenerator.FBlock.AddMethod(string)'

bezieht sich auf folgende Zeile in der FBlock.cs-Datei

 public Method AddMethod(string aName)

machen Methode die Klasse ist nicht öffentlich, die Fehler beheben. Ich kann nicht herausfinden, warum habe ich nicht den Fehler beim Aufruf der Property-Klasse. Und ich verstehe nicht, warum die Methode der Klasse öffentlichkeit nicht das problem zu beheben.

Irgendwelche Ideen?

Bearbeitet zu Fragen. könnte es irgendeine Einstellung auf die Datei, die Ursachen dieser?

InformationsquelleAutor der Frage scott | 2010-09-08

Schreibe einen Kommentar