/// <summary> /// Removes a PropertyType from the current ContentType /// </summary> /// <param name="propertyTypeAlias">Alias of the <see cref="PropertyType"/> to remove</param> public void RemovePropertyType(string propertyTypeAlias) { //check if the property exist in one of our collections if (PropertyGroups.Any(group => group.PropertyTypes.Any(pt => pt.Alias == propertyTypeAlias)) || _propertyTypes.Any(x => x.Alias == propertyTypeAlias)) { //set the flag that a property has been removed HasPropertyTypeBeenRemoved = true; } foreach (var propertyGroup in PropertyGroups) { propertyGroup.PropertyTypes.RemoveItem(propertyTypeAlias); } if (_propertyTypes.Any(x => x.Alias == propertyTypeAlias)) { _propertyTypes.RemoveItem(propertyTypeAlias); } }
/// <summary> /// Removes a PropertyType from the current ContentType /// </summary> /// <param name="propertyTypeAlias">Alias of the <see cref="PropertyType"/> to remove</param> public void RemovePropertyType(string propertyTypeAlias) { foreach (var propertyGroup in PropertyGroups) { propertyGroup.PropertyTypes.RemoveItem(propertyTypeAlias); } if (_propertyTypes.Any(x => x.Alias == propertyTypeAlias)) { _propertyTypes.RemoveItem(propertyTypeAlias); } }