private static bool PropertiesFromType(Type type, out ConfigurationPropertyCollection result) {
ConfigurationPropertyCollection properties = (ConfigurationPropertyCollection)s_propertyBags[type];
result = null;
bool firstTimeInit = false;
if (properties == null) {
lock (s_propertyBags.SyncRoot) {
properties = (ConfigurationPropertyCollection)s_propertyBags[type];
if (properties == null) {
properties = CreatePropertyBagFromType(type);
s_propertyBags[type] = properties;
firstTimeInit = true;
}
}
}
result = properties;
return firstTimeInit;
}