private void BuildPropertyTypeAssignments(DataTable table)
{
foreach (DataRow row in table.Rows)
{
int propertyTypeId = TypeConverter.ToInt32(row["PropertyTypeId"]);
int propertySetId = TypeConverter.ToInt32(row["PropertySetID"]);
bool isDeclared = TypeConverter.ToBoolean(row["IsDeclared"]);
PropertyType propertyType = _propertyTypes.GetItemById(propertyTypeId);
if (propertyType == null)
{
throw new InvalidSchemaException(String.Concat(SR.Exceptions.Schema.Msg_PropertyTypeDoesNotExist, ": id=", propertyTypeId));
}
PropertySet propertySet = null;
if (propertyType.IsContentListProperty)
{
propertySet = _contentListTypes.GetItemById(propertySetId);
}
else
{
propertySet = _nodeTypes.GetItemById(propertySetId);
}
if (isDeclared)
{
AddPropertyTypeToPropertySet(propertyType, propertySet);
}
}
}