![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | How to refer to enums with a dot in the name? Hi all, I've been banging my head against the wall since I found that I can't refer to an enum with a dot in the name just like I do with a normal enum: PS > [Microsoft.SharePoint.SPListTemplateType]::GenericList GenericList PS > [Microsoft.SharePoint.SPWeb.WebAnonymousState]::Enabled Unable to find type [Microsoft.SharePoint.SPWeb.WebAnonymousState]: make sure that the assembly containing this type is loaded. At line:1 char:47 + [Microsoft.SharePoint.SPWeb.WebAnonymousState]: <<<< :Enabled Anyone know how to do this? |
My System Specs![]() |
| | #2 (permalink) | ||||||||||||
| Guest | Re: How to refer to enums with a dot in the name? On Feb 29, 10:27*am, l0b0 <victor.engm...@xxxxxx> wrote:
What you're referring to is a nested type: a class/struct/enum that has been defined within a class. There is a special syntax for this in .NET which you can discover using some tricks: PS C:\> [microsoft.sharepoint.spweb].GetNestedTypes() IsPublic IsSerial Name BaseType -------- -------- ---- -------- False True WebAnonymousState System.Enum So, lets get the full name of this nested type: PS C:\> [microsoft.sharepoint.spweb].GetNestedTypes()[0].Fullname Microsoft.SharePoint.SPWeb+WebAnonymousState As you can see, it's not a dot, but rather a +. So: PS C:\projects> [Microsoft.SharePoint.SPWeb+WebAnonymousState] IsPublic IsSerial Name BaseType -------- -------- ---- -------- False True WebAnonymousState System.Enum Hope this helps, - Oisin http://www.nivot.org/ | ||||||||||||
My System Specs![]() | |||||||||||||
| | #3 (permalink) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Guest | Re: How to refer to enums with a dot in the name? On Feb 29, 5:27 pm, "Oisin (x0n) Grehan [MVP]" <ois...@xxxxxx> wrote:
-- Victor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| In any project, Can't we refer classes directly, (without addingphysically in the project)? | Rachana | .NET General | 1 | 03-28-2008 04:31 PM |
| Using Enums | Andy Webster | PowerShell | 1 | 01-29-2007 09:03 AM |