Re: return a private enum

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I don't think that will compile. The reason is that your return type
is of type Status, but you're not letting the outside world know how
Status is defined.

You'll have to make the enum public.

HTH
Andy

Valmont wrote:
Complete newbie at C#.

Class below stripped for brevity.
How do I return a private "Status" from a public method?
I may need a set/get but I don't know how to do that on an enum.

Thank you.


public class SomeClass
{
private enum Status {OK , NOK, UNK};

public Status check_status()
{
//...code to determine Status...
return NOK;
}
}

.



Relevant Pages