0

Two namespaces and similar class name inside in C#

by Deepak Dhakal 7. February 2012 13:04
I have namaspace for two version of the same class, V1 and v2
namespace Hello.ThisIsAnExample.Noway.StillAnExample.V1
{
Class A
{
public void Nothing()
{
}
}
}

namespace Hello.ThisIsAnExample.Noway.StillAnExample.V2
{
Class A
{
public void Nothing()
{
}
}
}


Then in the Main class, use like this

using V1=Hello.ThisIsAnExample.Noway.StillAnExample.V1
using V2=Hello.ThisIsAnExample.Noway.StillAnExample.V2

Pubic Main()
{
 V1.A.Nothing(); // Calls V1
 V2.A.Nothing(); // Calls V2
}



Sweet !!! is not it ???

Tags:

.Net

Powered by BlogEngine.NET 1.5.0.7
Original Design by Laptop Geek, Adapted by onesoft