Your method:
public Code.Indicators ShowForm() // Error
{
return new Code.Indicators(indicators.isComputerAlreadyRunning);
}
It returns an Indicators
object and is of public
visibility. However the type Indicators
itself is not public
, it's internal
(by default, since you did not specify it ; see this answer for more information).
Declare the class Indicators
as public
to solve the issue, or set the method ShowForm
as internal
.
Edit:
To better explain why the compiler complains, imagine your code is actually compiled to a library. Somebody includes this library from another assembly to use it, and this somebody is going to call this public
method ShowForm
(because he can!).
He is going to get a reference pointing to an Indicators
but from his point of view (actually from his assembly's point of view), he does not know what the class Indicators
is, because its visibility is internal
(as I said, by default). internal
elements are not exposed to other assemblies on the contrary of public
elements. This creates an incoherence and that it the reason why the compiler complains.