473,657 Members | 2,435 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_man ipulation.cs
etc ...
thx

S.
Mar 31 '06 #1
4 8119
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.co m> 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.You rProject.Librar y
{
...
}

// fileio.cs
namespace YourCompany.You rProject.Librar y
{
...
}

// xml.cs
namespace YourCompany.You rProject.Librar y
{
...
}

// img_manipulatio n.cs
namespace YourCompany.You rProject.Librar y
{
...
}

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************* ***@TK2MSFTNGP1 1.phx.gbl...
"Steph" <pi**@pipo.co m> 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.You rProject.Librar y
{
...
}

// fileio.cs
namespace YourCompany.You rProject.Librar y
{
...
}

// xml.cs
namespace YourCompany.You rProject.Librar y
{
...
}

// img_manipulatio n.cs
namespace YourCompany.You rProject.Librar y
{
...
}
hum... yes... i m missing something...
so i can do :
csc /target:library /out:mylibrary.d ll 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.d ll 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************* ***@TK2MSFTNGP1 1.phx.gbl...
"Steph" <pi**@pipo.co m> 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.You rProject.Librar y
{
...
}

// fileio.cs
namespace YourCompany.You rProject.Librar y
{
...
}

// xml.cs
namespace YourCompany.You rProject.Librar y
{
...
}

// img_manipulatio n.cs
namespace YourCompany.You rProject.Librar y
{
...
}

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
1641
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 partial types and that IF you have a Extends keyword, I think, before the class name AND the same Namespace, .NET will automatically compile the rest of the class that is located in another file. However, I want to know just exactly how is .NET...
7
2097
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 that my implementation will only choose the partial specialization for std::vector when std::swap is used.
9
2518
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. I.e. do we have to need to write:
7
1626
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 the global namespace which is called the same way than your codebehind class and another class under ASP namespace which is called the way you named your ASPX file (using underscores instead of dots). It's not enough, it playces the files you...
9
5779
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, EventArgs e) { Data_List(); } }
0
1376
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 is not possible to organize them in distinct files. This would result in cyclic imports. To manage the complexity I implemented some sort of aspect oriented programming (perhaps aspect oriented programming is not quite right in this...
3
5458
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
7407
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 example namespace myCompany. MyApp.Web { } the page starts throwing error, and rightly so because, its a partial class public partial class _Default : System.Web.UI.Page and the other part of it is not in the same namespace. The error message in
5
1977
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 business logic layer is decorated using the <System.ComponentModel.DataObject()> attributes and they are used to bind to controls and Object datasets on web forms. Is there a resonable way to set the WHERE clause on the fly with a partial class...
2
2113
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 orig defintion that compiles and runs fine in vs2005 is bellow......
0
8310
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8826
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7330
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6166
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4306
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.