private bool InitializeWithStatus()
{
if (!_initialized)
{
lock (IntializedLock)
{
if (_initialized || _initializing)
{
return false;
}
// This method is re-entrent during initialization, since calls to OnValueChanged() in subclasses could end up having InitializeWithStatus()
// called again, we don't want to get caught in an infinite loop.
_initializing = true;
_switchValueString = _defaultValue;
OnValueChanged();
_initialized = true;
_initializing = false;
}
}
return true;
}