Home All Groups Group Topic Archive Search About

Inconsistent accessibility

Author
12 Jun 2009 3:27 PM
Lou
I have a form that I want to pass a collection into the constructor but
can't seem to do it.

I keep getting the error "Inconsistent accessibility: "



public frmDeviceManager(Dictionary<string,Data> Devices)

{

InitializeComponent();



}





Data is a class



-Lou

Author
12 Jun 2009 3:31 PM
Daniel Cigic
Make sure that Data class is public?

Show quoteHide quote
"Lou" <lou.gar***@comcast.net> wrote in message
news:OMMzBJ36JHA.5180@TK2MSFTNGP04.phx.gbl...
> I have a form that I want to pass a collection into the constructor but
> can't seem to do it.
>
> I keep getting the error "Inconsistent accessibility: "
>
>
>
> public frmDeviceManager(Dictionary<string,Data> Devices)
>
> {
>
> InitializeComponent();
>
>
>
> }
>
>
>
>
>
> Data is a class
>
>
>
> -Lou
>
>
Are all your drivers up to date? click for free checkup

Author
12 Jun 2009 4:52 PM
Registered User
Show quote Hide quote
On Fri, 12 Jun 2009 11:27:10 -0400, "Lou" <lou.gar***@comcast.net>
wrote:

>I have a form that I want to pass a collection into the constructor but
>can't seem to do it.
>
>I keep getting the error "Inconsistent accessibility: "
>
>
>
>public frmDeviceManager(Dictionary<string,Data> Devices)
>
....
>
>Data is a class
>
From the code provided it appears the Data class' visibility is less
than public.

regards
A.G.
Author
12 Jun 2009 5:37 PM
Peter Duniho
On Fri, 12 Jun 2009 08:27:10 -0700, Lou <lou.gar***@comcast.net> wrote:

> I have a form that I want to pass a collection into the constructor but
> can't seem to do it.
>
> I keep getting the error "Inconsistent accessibility: "

So, make the accessibility consistent.

You can't have method declarations that include types that are less 
visible than the method itself.

Bookmark and Share