namespace question - basics

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?anAybXNmdA==?=

    namespace question - basics

    How do I include namespaces in my projects?

    It is getting to where several of my projects use a lot of the same code, so
    I have placed this code in a separate class. It does not need to be edited
    often, and it can remain closed for the most part.

    However, I would like to have a single file for this class, but I don't know
    how to do this right now. I've seen it before, but I don't remember what it
    was called, so I don't know what to search.

    If my class is declared as namespace "Company_Cl ass" and my projects are
    namespaced "Company_Projec tA" and "Company_Projec tB", how do one of my
    "Company_Projec tX" namespaces use the "Company_Cl ass" namespace? It seems
    like it is included at the top like "using Company_Class;" or something like
    that.

    Could someone show me this?
  • Peter Morris

    #2
    Re: namespace question - basics

    Right-click your solution then select the menu

    Add->New Project->Class Library

    namespace MyCompany.Somet hingElse
    {
    public class MyClass { }
    }


    In the other project right-click References and select "Add reference", then
    click the [Projects] tab and select that new class library.



    --
    Pete
    =============== =============== ===========
    I use Enterprise Core Objects (Domain driven design)

    =============== =============== ===========


    Comment

    Working...