hi everyone ,
Im having problems in saving values in the static variables. Here it is how it goes
i have 3 projects in a solution. Lets say A , B and C.
I have added the references of C in A and B
A calls C and saves a value .
Later B calls C but B get the value as 0(even though this variable wasnt used anywhere in between)
this is how my code looks like
A:
Code:public class Program
{
static void Main(string[] args)
{
...
...
Mediator.Class1 mediat = new Mediator.Class1();
mediat.test(4);
waitHandle.WaitOne();
}
}
B:
C:Code:...
...
Mediator.Class1 mediat = new Mediator.Class1();
mediat.recieveEle(request);
Code:public class Class1
{
public static int m_globalVar = 0;
int j;
public static int GlobalVar
{
get { return m_globalVar; }
set { m_globalVar = value; }
}
public void test( int i)
{
GlobalVar = i;
}
public void recieveEle(Element ele)
{
j = GlobalVar;
}
}

