[C#]Quel accès déclarer pour une List<structure> ?
Bonjour à tous,
j'ai un problème avec une List typée.
Je veux créer une propriété pour une List de structure et le compilateur ne veut pas que ma propriété soit public...
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| private List<ControlDetail> _control;
struct ControlDetail
{
public String controlName;
public Boolean controlRead;
public Boolean controlNew;
public Boolean controlModify;
public Boolean controlDelete;
}
public List<ControlDetail> Control
{
get { return _control; }
set { _control = value; }
} |
Si je mets ma propriété en private, il me fait ceci :
Citation:
Error 1 Inconsistent accessibility: property type 'System.Collections.Generic.List<ControlAddedTest.User.ControlDetail>' is less accessible than property 'ControlAddedTest.User.Control' C:\Documents and Settings\delvauxs\My Documents\Visual Studio 2005\Projects\ControlAddedTest\ControlAddedTest\User.cs 31 36 ControlAddedTest
Si je la mets en private, je ne peux bien sûr pas m'en servir...
Je me demande où j'ai loupé un épisode, car j'ai dans cette même classe 4 autres propriétés publiques avec des attributs privés...
Re: [C#] List de structure
Essayes
Code:
1 2 3
|
public struct ControlDetail
//...etc... |