2 objects with same name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a System.Windows.Forms.Application and a MapPoint.Application. How
tell the compiler that if I type: Application, that I mean
System.Windows.Forms.Application ?

Of course I can declare a var for it but I wonder if there are other ways ?
 
I have a System.Windows.Forms.Application and a MapPoint.Application. How
tell the compiler that if I type: Application, that I mean
System.Windows.Forms.Application ?

Include

using System.Windows.Forms;

and remove any

using MapPoint;

statements from the file.




Mattias
 
There are two ways as far as I know.

1. You can have 'using' directive for one of the namespaces and use fully
qualified names for the other.

2. You can shorten the name space path like that:

I think that syntax is as follows:

using Windows.Forms WF;
using MapPoint;

then you can refer to MapPoint:

Application app1;

and to Windows.Forms:

WF.Application app2;
 
using Windows.Forms WF;

unfortionally this dont works in my IDE. I'm using C#2005 beta, so probably
the reason :( Other ways ? (precide typing the whole namespace for one of
the 2)
 
using Windows.Forms WF;
unfortionally this dont works in my IDE. I'm using C#2005 beta, so probably
the reason :( Other ways ? (precide typing the whole namespace for one of
the 2)

no the correct syntax is

using WF = System.Windows.Forms;

thats why is didn't work for you.
 
Back
Top