Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Namespaces Question
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00942700
Message ID:
00942804
Views:
14
Shawn,

The namespace keyword allows you to create globally-unique types and are typically used in a hierarchal fashion.
using System;

namespace Hierarchy1
{
   /// <summary>
   /// Summary description for Class1.
   /// </summary>
   class Class1
   {
      /// <summary>
      /// The main entry point for the application.
      /// </summary>
      [STAThread]
      static void Main(string[] args)
      {
      //
      // TODO: Add code to start application here
      //
      }

      public void Test()
      {
      }
}

   namespace Hierarchy2
   {
      class Class2
      {
      }
   }
}
However using namespace inside of your type definition will generate a CS1519 compiler error which makes sense if you think in terms of type and not methods.

Regards
Neil
Previous
Reply
Map
View

Click here to load this message in the networking platform