473,399 Members | 3,302 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

how do i get a list of types in a namespace?



Say i have namespace FOO..

and i want to get a list of all the types that are declared in FOO

how can i do this?
Nov 16 '05 #1
4 1933
reflection may be useful to you,if you want to get the infomation from
an assembly
On Fri, 18 Jun 2004 14:18:11 +1000, "Darren Clark"
<dc******@hotmail.com> wrote:


Say i have namespace FOO..

and i want to get a list of all the types that are declared in FOO

how can i do this?


--------------------
chaor
ch***@chaor.vicp.net
Nov 16 '05 #2
hi,

try this one:

foreach (Type type in Assembly.LoadFrom
("<your assembly location>").GetTypes())
{
Console.WriteLine(type.ToString
());
}

HTH,

--
gani
http://thedeveloperscorner.com.ph

-----Original Message-----
Say i have namespace FOO..

and i want to get a list of all the types that are declared in FOO
how can i do this?
.

Nov 16 '05 #3
Darren,

try this

//get the assembly
Assembly myAssembly = Assembly.GetExecutingAssembly();

//get the types defined in the assembly
System.Type [] allTypes = myAssembly.GetTypes();

Shak.
"Darren Clark" <dc******@hotmail.com> wrote in message
news:OR**************@TK2MSFTNGP11.phx.gbl...


Say i have namespace FOO..

and i want to get a list of all the types that are declared in FOO

how can i do this?

Nov 16 '05 #4
thank you all..

it worked!
Assembly a = Assembly.LoadFile(this.textBox1.Text.ToString());

Type[] mytypes = a.GetTypes();

foreach(Type t in mytypes)

{

tvMain.Nodes.Add(t.FullName.ToString());

}

"Shakir Hussain" <sh**@fakedomain.com> wrote in message
news:eZ**************@TK2MSFTNGP11.phx.gbl...
Darren,

try this

//get the assembly
Assembly myAssembly = Assembly.GetExecutingAssembly();

//get the types defined in the assembly
System.Type [] allTypes = myAssembly.GetTypes();

Shak.
"Darren Clark" <dc******@hotmail.com> wrote in message
news:OR**************@TK2MSFTNGP11.phx.gbl...


Say i have namespace FOO..

and i want to get a list of all the types that are declared in FOO

how can i do this?


Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Andy Skypeck | last post by:
I am looking for some validation against a dubious coding practice that prevails where I work. C types defined in types.h (Linux) or stdint.h (Windows, C99?) are used as if they belong to the C++...
2
by: Nicolas Fleury | last post by:
Hi, I have a field named "BaseClasses" in C++ as in the following simplified code: using Collections::Generic::List; namespace A2M { namespace LipIntrospection { public ref class...
1
by: louis_la_brocante | last post by:
Dear all, I am having trouble generating a client proxy for a webservice whose methods return a "complex" type. The type is complex in that it is a class whose members are a mix of primitive...
6
by: ahart | last post by:
I'm pretty new to python and am trying to write a fairly small application to learn more about the language. I'm noticing some unexpected behavior in using lists in some classes to hold child...
4
by: martin | last post by:
Hi, I have some rather unusual questions? How do I list/enumerate all classes in a namespace? How do I list/enumerate all classes in a assembly? How do I list/enumerate all classes in .NET? ...
1
by: johnnyD | last post by:
How would I traverse through a namespace and determine all the object types that implement an interface. For instance in the namespace "Microsoft.SqlServer.Management.Smo" Namespace I want to...
4
by: J2EE Convert | last post by:
Hello, Sorry if this has already been beaten to death. However, I was not able to find the answer in my searches. Is there any performance trade off between creating and using a generic list of...
2
by: Joh | last post by:
Is there a way to dynamically list all System types that exist in VB.Net? I.e. I'd like to list all types in the System namespace programatically.
2
by: Fred Mellender | last post by:
I am trying to use reflection to output the fields (names and values) of an arbitrary object -- an object dump to a TreeView. It works pretty well, but I am having trouble with generic lists,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.