Getting a list of available Namspaces for an assembly

  • Thread starter Thread starter Lee Alexander
  • Start date Start date
L

Lee Alexander

I want to find out all the namespaces for an assembly and convert them into
a tree that I can then traverse for use in an autocomplete popup. Now I
figure I can do it by running over all the exported types of the assembly
and getting the namespaces they are in but is there a better way???


Regards
Lee
 
Hi,

Lee said:
I want to find out all the namespaces for an assembly and convert them into
a tree that I can then traverse for use in an autocomplete popup. Now I
figure I can do it by running over all the exported types of the assembly
and getting the namespaces they are in but is there a better way???

As i see in docs, namespaces are only "Type" property.

I think that only way is to iterate all types and create treeView
nodes only when those aren't exists.

e.g. if treeview has namespaces only

1. type "FirstSpace.SecondSpace.FirstType"

add node "FirstSpace"
set current at "FirstSpcae"
add node "SecondSpace"

2. type "FirstSpace.SecondType"

do nothing

3. type "FirstSpace.ThirdSpace.ThirdType"

set current at "FirstSpcae"
add node "ThirdSpace"

4. type "FirstSpace.SecondSpace.FourthType"

do nothing

Regards

Marcin
 
Thanks I figured I would have to go over the assembly manually; not a big
deal.

Regards
Lee
 
Thanks for your reply, I was really looking for an out of the box solution
but it's not a big deal to do it anyway. I was just checking so as to not
reinvent the wheel.

Regards
Lee
 
Back
Top