473,386 Members | 1,621 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,386 software developers and data experts.

How do i get the namespace at compile time?


How do i get the namespace of a class at compile time?

Thanks


Nov 16 '05 #1
6 2111
Why do you need the namespace in compile-time?

--
Patrik Löwendahl [C# MVP]
www.cshrp.net - "Elegant code by witty programmers"
"Julia" <co********@012.net.il> wrote in message
news:u$**************@TK2MSFTNGP11.phx.gbl...

How do i get the namespace of a class at compile time?

Thanks

Nov 16 '05 #2
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 [C# MVP]" <pa**************@csharpsweden.com> wrote in
message news:uR**************@tk2msftngp13.phx.gbl...
Why do you need the namespace in compile-time?

--
Patrik Löwendahl [C# MVP]
www.cshrp.net - "Elegant code by witty programmers"
"Julia" <co********@012.net.il> wrote in message
news:u$**************@TK2MSFTNGP11.phx.gbl...

How do i get the namespace of a class at compile time?

Thanks


Nov 16 '05 #3
Julia <co********@012.net.il> wrote:
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

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #4
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" <co********@012.net.il> wrote in message
news:OS*************@TK2MSFTNGP15.phx.gbl...
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 [C# MVP]" <pa**************@csharpsweden.com> wrote in
message news:uR**************@tk2msftngp13.phx.gbl...
Why do you need the namespace in compile-time?

--
Patrik Löwendahl [C# MVP]
www.cshrp.net - "Elegant code by witty programmers"
"Julia" <co********@012.net.il> wrote in message
news:u$**************@TK2MSFTNGP11.phx.gbl...
>
> How do i get the namespace of a class at compile time?
>
>
>
> Thanks
>
>
>
>



Nov 16 '05 #5
I am loading an HTML page
which type should i use?!
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Julia <co********@012.net.il> wrote:
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

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 16 '05 #6
Julia <co********@012.net.il> wrote:
I am loading an HTML page
which type should i use?!


Any type in the namespace you want to get...

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #7

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

Similar topics

4
by: Teddy | last post by:
If I use just a STL container such as std::vector in my program. Is "using std::vector;" better than "using namespace std" ? Does "using namespace std" cost ?
4
by: Lodewijk Smit | last post by:
Hi, In the C standard of 1999 additional mathematical functions are added. For example, beside the traditional double sin(double x); there are also the functions: float sinf(float x);...
5
by: Genboy | last post by:
My "VIS" Website, which is a C# site created in VS.NET, Framework 1.1, is no longer compiling for me via the command line. As I have done 600 times in the last year and a half, I can compile to...
29
by: Natan | last post by:
When you create and aspx page, this is generated by default: using System; using System.Collections; using System.Collections.Specialized; using System.Configuration; using System.Text; using...
6
by: ryan.d.rembaum | last post by:
Hello, I have code that I wish to use in many web applications. Basically sort of stand utility stuff. So from Visual Studio Project I select add a component and chose Component Class. Lets...
29
by: Tiraman | last post by:
Hi, I Build my own dll with my own namespace name and i would like to put it in one place but for the project bin folder so all of the projects will be able to use it . i tried to put the dll...
14
by: Jon Rea | last post by:
I am currently cleaning up an application which was origainlly hashed together with speed of coding in mind and therefore contains quite a few "hacky" shortcuts. As part of this "revamping"...
12
by: bgeneto | last post by:
I know that it's a very basic question, but I can't figure out or find an answer to why do we have to specify a namespace, like this #include<string> using namespace std; when using the...
7
by: zahy[dot]bnaya[At]gmail[dot]com | last post by:
Hi all, Since I am always confusing this, I want to know once and for all what is the right way of doing this. I've noticed that some programs use: std::cout<< "yadayada"<<endl;
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...

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.