473,545 Members | 1,878 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How To Use Nested Namespace [Help]

Hi ,

I would like to use nested namespace .

I have 3 namespace as dll's :
Namespace A
Namespace B
Namespace C

And i want to have some namespace that contain them all , some thing like

Namespace MyComp.A.B.C
Or
Namespace MyComp.A.B or Namespace B.C And so on ...

(e.g ---> System.Data)

please help
Nov 20 '05 #1
14 3310
By default, your project name becomes the "root namespace" of your assembly.
If you are using VS.NET, just right click on the project in the Solution
Explorer and you'll see an option to change the name of the Root Namespace
there.

To create sub-namespaces, do exactly what you wrote down below (remembering
to end each namespace):

Namespace A
Namespace B
Namespace C

Public Class Foo
End Class

End Namespace
End Namespace
End Namespace

All 3 namespaces are part of the root namespace (project name by default or
you change in project properties) and Foo is in the namespace:

RootNamespace.A .B.C.Foo

"Tiraman" <ti*****@netvis ion.net.il> wrote in message
news:eU******** ******@TK2MSFTN GP09.phx.gbl...
Hi ,

I would like to use nested namespace .

I have 3 namespace as dll's :
Namespace A
Namespace B
Namespace C

And i want to have some namespace that contain them all , some thing like

Namespace MyComp.A.B.C
Or
Namespace MyComp.A.B or Namespace B.C And so on ...

(e.g ---> System.Data)

please help

Nov 20 '05 #2
By default, your project name becomes the "root namespace" of your assembly.
If you are using VS.NET, just right click on the project in the Solution
Explorer and you'll see an option to change the name of the Root Namespace
there.

To create sub-namespaces, do exactly what you wrote down below (remembering
to end each namespace):

Namespace A
Namespace B
Namespace C

Public Class Foo
End Class

End Namespace
End Namespace
End Namespace

All 3 namespaces are part of the root namespace (project name by default or
you change in project properties) and Foo is in the namespace:

RootNamespace.A .B.C.Foo

"Tiraman" <ti*****@netvis ion.net.il> wrote in message
news:eU******** ******@TK2MSFTN GP09.phx.gbl...
Hi ,

I would like to use nested namespace .

I have 3 namespace as dll's :
Namespace A
Namespace B
Namespace C

And i want to have some namespace that contain them all , some thing like

Namespace MyComp.A.B.C
Or
Namespace MyComp.A.B or Namespace B.C And so on ...

(e.g ---> System.Data)

please help

Nov 20 '05 #3
namespace MyCompany.A.B.C {
class Foo {
}
}

Gives a class called MyCompany.A.B.C .Foo
"Tiraman" <ti*****@netvis ion.net.il> wrote in message
news:eU******** ******@TK2MSFTN GP09.phx.gbl...
Hi ,

I would like to use nested namespace .

I have 3 namespace as dll's :
Namespace A
Namespace B
Namespace C

And i want to have some namespace that contain them all , some thing like

Namespace MyComp.A.B.C
Or
Namespace MyComp.A.B or Namespace B.C And so on ...

(e.g ---> System.Data)

please help

Nov 20 '05 #4
namespace MyCompany.A.B.C {
class Foo {
}
}

Gives a class called MyCompany.A.B.C .Foo
"Tiraman" <ti*****@netvis ion.net.il> wrote in message
news:eU******** ******@TK2MSFTN GP09.phx.gbl...
Hi ,

I would like to use nested namespace .

I have 3 namespace as dll's :
Namespace A
Namespace B
Namespace C

And i want to have some namespace that contain them all , some thing like

Namespace MyComp.A.B.C
Or
Namespace MyComp.A.B or Namespace B.C And so on ...

(e.g ---> System.Data)

please help

Nov 20 '05 #5
"Martin Robins" <martin - robins @ ntlworld dot com> schrieb
namespace MyCompany.A.B.C {
class Foo {
}
}

Gives a class called MyCompany.A.B.C .Foo


Not in VB.NET. ;-)
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #6
"Martin Robins" <martin - robins @ ntlworld dot com> schrieb
namespace MyCompany.A.B.C {
class Foo {
}
}

Gives a class called MyCompany.A.B.C .Foo


Not in VB.NET. ;-)
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #7
Hi Tiraman,

First of all, I would like to confirm my understanding of your issue.
From your description, I understand that you wants to use a nested
namespace.
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.

I think you may take a look at the two links below.
Namespace Naming Guidelines
http://msdn.microsoft.com/library/de...us/cpgenref/ht
ml/cpconnamespacen amingguidelines .asp

Namespace Statement
http://msdn.microsoft.com/library/de...us/vblr7/html/
vastmnamespace. asp

Please apply my suggestion above and let me know if it helps resolve your
problem.
Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #8
Hi Tiraman,

First of all, I would like to confirm my understanding of your issue.
From your description, I understand that you wants to use a nested
namespace.
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.

I think you may take a look at the two links below.
Namespace Naming Guidelines
http://msdn.microsoft.com/library/de...us/cpgenref/ht
ml/cpconnamespacen amingguidelines .asp

Namespace Statement
http://msdn.microsoft.com/library/de...us/vblr7/html/
vastmnamespace. asp

Please apply my suggestion above and let me know if it helps resolve your
problem.
Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #9
Ok ,

I found where I can change the Root Namespace which is good but let me
describe you what I want to do .

lets say that I have a company name Comp and we have 3 Departments (A,B,C)

now each department working on some namespace and on its class's and I want
to make one namespace

that will include them all (not the code !!! just the call or the import to
those namespace's ) and if we will open a new department tomorrow

I want the ability to add a call or include or import to the new department
(namespace) into the root namespace

so every one that use this root namespace will be able to use other public
functions .

10x
"Scott M." <s-***@BADSPAMsnet .net> wrote in message
news:u6******** ******@TK2MSFTN GP09.phx.gbl...
By default, your project name becomes the "root namespace" of your assembly. If you are using VS.NET, just right click on the project in the Solution
Explorer and you'll see an option to change the name of the Root Namespace
there.

To create sub-namespaces, do exactly what you wrote down below (remembering to end each namespace):

Namespace A
Namespace B
Namespace C

Public Class Foo
End Class

End Namespace
End Namespace
End Namespace

All 3 namespaces are part of the root namespace (project name by default or you change in project properties) and Foo is in the namespace:

RootNamespace.A .B.C.Foo

"Tiraman" <ti*****@netvis ion.net.il> wrote in message
news:eU******** ******@TK2MSFTN GP09.phx.gbl...
Hi ,

I would like to use nested namespace .

I have 3 namespace as dll's :
Namespace A
Namespace B
Namespace C

And i want to have some namespace that contain them all , some thing like
Namespace MyComp.A.B.C
Or
Namespace MyComp.A.B or Namespace B.C And so on ...

(e.g ---> System.Data)

please help


Nov 20 '05 #10

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

Similar topics

26
29606
by: Joshua Beall | last post by:
Hi All, I remember reading that both nested classes and namespaces would be available in PHP5. I know that namespaces got canceled (much sadness...), however, I *thought* that nested classes were still an option. However, I am coming up dry looking for information on how to do this, and the most recent references I am able to find to...
3
1204
by: Rubén Campos | last post by:
Organizing classes, types, structures, enums and whatever other entities into nested namespaces requires to include into every header and implementation file the complete path of namespaces. Let me show an example: classes.hpp classes.cpp util.hpp util.cpp main.cpp // classes.hpp namespace Classes { class MyBaseClass {
6
1644
by: SpOiLeR | last post by:
Why doesn't following code compile? Problem line is commented in code. ---------------------- Cut here------------------------------- #include <iostream> #include <list> #include <string> using namespace std;
1
1201
by: Sebastian Dau | last post by:
Hi there, I'm trying to design a form with the help of the VS2003 C++ Forms designer. This works pretty good as long as the form is not included in a nested namespace. Example (works) namespace MyFirstNS {
14
1150
by: Tiraman | last post by:
Hi , I would like to use nested namespace . I have 3 namespace as dll's : Namespace A Namespace B Namespace C And i want to have some namespace that contain them all , some thing like
37
2748
by: Tim N. van der Leeuw | last post by:
Hi, The following might be documented somewhere, but it hit me unexpectedly and I couldn't exactly find this in the manual either. Problem is, that I cannot use augmented assignment operators in a nested scope, on variables from the outer scope: PythonWin 2.4.3 (#69, Mar 29 2006, 17:35:34) on win32. Portions Copyright 1994-2004 Mark...
78
4898
by: Josiah Manson | last post by:
I found that I was repeating the same couple of lines over and over in a function and decided to split those lines into a nested function after copying one too many minor changes all over. The only problem is that my little helper function doesn't work! It claims that a variable doesn't exist. If I move the variable declaration, it finds the...
3
1906
by: Wayne Shu | last post by:
When I read the chapter of the namespace of the book C++ Primer(3e). It explain the using directive as follow: "A using directive makes the namespace member names visible as if they were declared outside the namespace at the location where the namespace definition is located." I have some doubt about the using directives for the nested...
2
2646
by: Wolfgang | last post by:
Hi, I'm trying to understand how could I inherit a nested class. Say for instance - I've four classes namely class A, class B, class C, class D. class B is nested inside class A class D is nested inside class C I'm trying to inherit class D from class B. Instantiating 'class A::B' as 'abObj' and want to understand
0
7486
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7416
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...
0
7676
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. ...
0
7776
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5347
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...
0
4965
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...
0
3473
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3456
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1905
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.