Re: Making Definitions
- From: Devon-S <DevonS@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 10 Mar 2008 10:37:07 -0700
Jon,
Just declare the enum outside any other type.
Thanks, I do appreciate the help. This nearly has it for me, but I don't see
how I use the declaration in other assemblies then. I know I should go back
and read a c# manual, but most of the time I get it (at least somewhat).
The ImageDisplaySize is used in a WebControl and in the top of the file that
declares the web control, I put
public enum ImageDisplaySize { Small, Medium, Large }
I would expect to be able to use it where I had dragged the WebUC onto the
page. But it doesnt appear when I go to set the property type.
I am sure this is very easy on the "Easy Button" scale. Appreciate the help.
regards:jamie
"Jon Skeet [C# MVP]" wrote:
Devon-S <DevonS@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:.
There is a great chance that I don't truely understand the enum. But since
the only examples at the link work exactly as I said in a class, sending me
back to how I didn't want them to work wasn't helpful to my lack of
understanding.
Peter didn't send you *back* to them - he sent you *to* them. You gave
no indication that you'd already looked at that page.
Furthermore, although the Days example is indeed a nested type (not a
subclass, by the way), the CarOptions one isn't.
But back to the problem...
There is a (something could be a type or a class) called FormViewMode. When
you want to change the mode of the form you do.
FormView1.ChangeMode(FormViewMode.Insert)
Ah, FormViewMode. Not FormView, which is a class. Yes, FormViewMode is
an enum, and Insert is a member of that enum.
<snip>
I would like to create a (whatever form view mode is) for ImageSize and have
three properties. Small Medium Large. I know I can do it sorta with an eNum.
But when I went to use it to access it, I had to do <Class>.EnumType.Property
Only if you make it a nested type.
With ImageSize it is actually going to be in lots of different places like
FormViewMode.
Appreciating the C# enlightenment...
Just declare the enum outside any other type.
--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
- Follow-Ups:
- Re: Making Definitions
- From: Jon Skeet [C# MVP]
- Re: Making Definitions
- From: Peter Duniho
- Re: Making Definitions
- References:
- Re: Making Definitions
- From: Peter Duniho
- Re: Making Definitions
- From: Jon Skeet [C# MVP]
- Re: Making Definitions
- From: Devon-S
- Re: Making Definitions
- From: Jon Skeet [C# MVP]
- Re: Making Definitions
- Prev by Date: Ignoring culture on DataGrid
- Next by Date: Re: Making Definitions
- Previous by thread: Re: Making Definitions
- Next by thread: Re: Making Definitions
- Index(es):