How do i get the namespace at compile time?

  • Thread starter Thread starter Julia
  • Start date Start date
I am loading a resource from a resource file
using
GetManifestResourceStream



and i dont want to pass the full name of the resource



Thanks.





Patrik Löwendahl said:
Why do you need the namespace in compile-time?

--
Patrik Löwendahl [C# MVP]
www.cshrp.net - "Elegant code by witty programmers"
Julia said:
How do i get the namespace of a class at compile time?



Thanks
 
Julia said:
I am loading a resource from a resource file
using
GetManifestResourceStream

and i dont want to pass the full name of the resource

Well, you can use typeof(...).Namespace
 
There is an overload of GetManifestResourceStream() taking Type as it's
first argument, in which case the Type's namespace is used.

HTH,
Stefan

Julia said:
I am loading a resource from a resource file
using
GetManifestResourceStream



and i dont want to pass the full name of the resource



Thanks.





Patrik Löwendahl said:
Why do you need the namespace in compile-time?

--
Patrik Löwendahl [C# MVP]
www.cshrp.net - "Elegant code by witty programmers"
Julia said:
How do i get the namespace of a class at compile time?



Thanks
 
Back
Top