473,504 Members | 13,830 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

partial namespace

hello,
can we do a partial namespace ?
i want split my cs file (contain all my classes) in a lot of files and then
compil their into my DLL...
so in this case, is more easy to work :

library.dll =
library.net.cs
library.fileio.cs
library.xml.cs
library.img_manipulation.cs
etc ...
thx

S.
Mar 31 '06 #1
4 8053
There is no requierment that all types that belong to a namespace must
be in the same file.

And I think you are missing something there. If you wan't to compile
everything into one DLL then make a Class library proejct put your
files there compile and you will get your DLL.

Mar 31 '06 #2
"Steph" <pi**@pipo.com> a écrit dans le message de news:
44***********************@news.wanadoo.fr...

| can we do a partial namespace ?

Namespaces can span more than one module (.cs file)

| i want split my cs file (contain all my classes) in a lot of files and
then
| compil their into my DLL...

Best practice is to only have one class per module unless the classes are
intimately related.

// net.cs
namespace YourCompany.YourProject.Library
{
...
}

// fileio.cs
namespace YourCompany.YourProject.Library
{
...
}

// xml.cs
namespace YourCompany.YourProject.Library
{
...
}

// img_manipulation.cs
namespace YourCompany.YourProject.Library
{
...
}

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer
Mar 31 '06 #3

"Joanna Carter [TeamB]" <jo****@not.for.spam> a écrit dans le message de
news: %2****************@TK2MSFTNGP11.phx.gbl...
"Steph" <pi**@pipo.com> a écrit dans le message de news:
44***********************@news.wanadoo.fr...

| can we do a partial namespace ?

Namespaces can span more than one module (.cs file)

| i want split my cs file (contain all my classes) in a lot of files and
then
| compil their into my DLL...

Best practice is to only have one class per module unless the classes are
intimately related.

// net.cs
namespace YourCompany.YourProject.Library
{
...
}

// fileio.cs
namespace YourCompany.YourProject.Library
{
...
}

// xml.cs
namespace YourCompany.YourProject.Library
{
...
}

// img_manipulation.cs
namespace YourCompany.YourProject.Library
{
...
}
hum... yes... i m missing something...
so i can do :
csc /target:library /out:mylibrary.dll xml.cs fileio.cs net.cs etc...
?
i m really miss something ;-)

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer

Mar 31 '06 #4
no work...
i create two .cs file :
"net.cs" with :
namespace myTest
{
public class netTest {
//...
}
}

and a "xml.cs" with :
namespace myTest
{
public class xmlTest {
//...
}
}
then i compil :

csc /target:library /out:mylibrary.dll xml.cs net.cs

but... in my "mylibrary.dll" i v not my "xmlTest" class (or "netTest")...

how do ?
"Joanna Carter [TeamB]" <jo****@not.for.spam> a écrit dans le message de
news: %2****************@TK2MSFTNGP11.phx.gbl...
"Steph" <pi**@pipo.com> a écrit dans le message de news:
44***********************@news.wanadoo.fr...

| can we do a partial namespace ?

Namespaces can span more than one module (.cs file)

| i want split my cs file (contain all my classes) in a lot of files and
then
| compil their into my DLL...

Best practice is to only have one class per module unless the classes are
intimately related.

// net.cs
namespace YourCompany.YourProject.Library
{
...
}

// fileio.cs
namespace YourCompany.YourProject.Library
{
...
}

// xml.cs
namespace YourCompany.YourProject.Library
{
...
}

// img_manipulation.cs
namespace YourCompany.YourProject.Library
{
...
}

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer

Mar 31 '06 #5

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

Similar topics

21
1614
by: nospam | last post by:
Ok, I asked this question before and I also looked at the book "First Look at ASP.NET 2.0" I also read Paul wilson's web page explanation. HOWEVER...... The book and that web page talks about...
7
2078
by: Kai-Uwe Bux | last post by:
Hi folks, I observed something that puzzles me. When I do namespace xxx { using std::swap; } it appears that xxx::swap and std::swap are not strictly equivalent. In particular, I think...
9
2501
by: Gomaw Beoyr | last post by:
Two question about the "partial classes" (in the next wersion of ..NET). Question 1 ========== Will partial classes (in the next version of C#) have to be declared "partial" in ALL places. ...
7
1623
by: Patrick | last post by:
Hi all, I was playing around with ASP.Net 2.0 and recognized that in case you use Code-Behind/Beside (how is it called in future?) the parser still creates TWO classes one partial class under...
9
5768
by: Fat Elvis | last post by:
I'd like to extend some of my Asp.net pages by using Partial Classes. Example ASP.Net Page: public partial class Admin_Customer : System.Web.UI.Page { protected void Page_Load(object sender,...
0
1363
by: Dr. Peer Griebel | last post by:
I'm currently writing a small toy application to support symbolic algebra. Therefore I implemented some classes Term, Var, Number, Sum, Product, Power. These classes are tightly coupled. So it...
3
5435
by: vivekian | last post by:
Hi, Is there a way to have partial classes across different namespaces ? namespace a.b.c { public partial class X { private void MyMethod () { } }
4
7396
by: Sami Rehman | last post by:
Hi I want to use namespaces to organize all the classes, web forms, and user controls. It works fine with my user defined classes, but when I try to put all the web pages in a namespace for...
5
1966
by: SAL | last post by:
Hello, I would like to be able to set the WHERE clause of a select statement on the fly. I have a DataAccess layer designed using the DataSet designer and a BusinessLogic layer using classes. The...
2
2098
by: Peted | last post by:
Hi, im moving a project from vs2005 to vs 2008. is doing so i have come across a compiler error regarding partial classes that i dont understand if anyone can explain it to me please the...
0
7213
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7098
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
7298
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
7366
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...
1
7017
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
7471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5026
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...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.