Herfried
Thanks for that. Reflection was the clue I needed, but I'm not completely
where I want to be. Since I'm effectively trying to emulate VB.NET:
Dim objObject As ...
where the ... is the IntelliSense drop-down box. Thus far I've created test
code:
Dim objSystemObject Assembly As [Assembly] =
[Assembly].GetAssembly(Ge tType(System.Ob ject))
Dim objTypes() As Type = objSystemObject Assembly.GetTyp es
I chose the System.Object which returns 1480 items, many of which are not
relevant, so I filtered out those that weren't 'Public'.
However in a Visual Studio project, one puts in references eg:
System
System.Data
System.Drawing
System.Windows. Forms
System.XML
and this extends the Types available. I'd like to do a similar thing for my
users. I could pick an object at random in (say) System.Data and replace
System.Object in the above code, but this doesn't seem very elegant. Is
there a better way of achieving this?
Regards
Crispin
"Herfried K. Wagner [MVP]" wrote:
"CrispinH" <Cr******@discu ssions.microsof t.com> schrieb: I'm building an application generator and within it a user can create a
new
property (for the class they are building). I'd like then to offer a list
of
Types - built-in and custom - for this new property to be shown in a combo
box ie similar to Intellisense.
How do you enumerate the Types available? Are their mechanisms for
filtering
the list to show only (say) primitive types or custom types or reference
types?
At runtime: 'System.Reflect ion', 'Assembly.GetTy pes', 'Type' class, ...
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>