Enums/Properties

  • Thread starter Thread starter Jim Heavey
  • Start date Start date
J

Jim Heavey

I created a class with an Enum and a Property.

In another class I instatiate that class (with an Enum and a Property),
but I can't seem to access it?

My code looks like the following:

public enum OutputType
{
Console=0,
Text=1,
Html=2
};

public ProviderType Provider // Identify the type of provider
{
get
{
return _provider;
}
set
{
_provider = value;
}
}

The code above belongs in a class called Fred and it compiles just fine

I have another class called "Mary" and I created an instance of Fred.

At this point I am able to see all of the methods of "Fred" (via
Intellisense), but I am not able to see this properties. My instruction
looks like the following:

OutSideClass.OutputType

Why Can't I see my Enum?
 
Jim Heavey said:
I created a class with an Enum and a Property.

In another class I instatiate that class (with an Enum and a Property),
but I can't seem to access it?

<snip>

The following code works fine for me - could you give a similarly short
but complete example which *doesn't* compile?

using System;

public class OuterClass
{
public enum OutputType
{
Console=0,
Text=1,
Html=2
}
}

public class Test
{
static void Main()
{
OuterClass.OutputType foo = OuterClass.OutputType.Text;
Console.WriteLine (foo);
}
}
 
Back
Top