What i have is the following:
using System;
namespace TestAfInstance.TestClass1
{
public class Class1
{
private static Class1 instance;
private string someVariable;
public static Class1 Instance()
{
if (instance == null)
{
instance = new Class1();
}
return instance;
}
public string SomeVariable
{
get{return someVariable;}
set{someVariable = value;}
}
}
}
Now i have several of these class'es but they differ in namespace.
However i found the solution - i have a baseclass implementing the
property SomeVariable wich the singletons inherits i then do the
following to have common code
BaseClass base = <somenamespace>.instance();
and then accesing base.SomeVariable for all the namespaces
Regards
Arne Rasmussen
*** Sent via Developersdex
http://www.developersdex.com ***