T
Tamir Khason
Questing:
Following program. I want on request of property of some class if the class
not initialized - do it, but the following returns exception (...not set to
the instance of the object...) Why?
SomeClass class = GetThisClass.SomeClass();
//Class
class SomeClass
{
public SomeClass()
{}
}
class GetThisClass
{
SomeClass m_class;
public GetThisClass()
{}
public SomeClass SomeClass
{
get
{
if(m_class == null)
m_class=new SomeClass(); //If the class is null
Initialize
return m_class;
}
set
{
m_class = value;
}
}
}
Following program. I want on request of property of some class if the class
not initialized - do it, but the following returns exception (...not set to
the instance of the object...) Why?
SomeClass class = GetThisClass.SomeClass();
//Class
class SomeClass
{
public SomeClass()
{}
}
class GetThisClass
{
SomeClass m_class;
public GetThisClass()
{}
public SomeClass SomeClass
{
get
{
if(m_class == null)
m_class=new SomeClass(); //If the class is null
Initialize
return m_class;
}
set
{
m_class = value;
}
}
}