protected void RemoveProperty(InstanceProperties instanceProperties, string propertyName) { for (int i = 0; i < instanceProperties.Properties.Count; i++) { if (string.Equals(instanceProperties.Properties[i].Name, propertyName)) { instanceProperties.Properties.RemoveAt(i--); } } }
public InstanceProperties GetInstanceProperties(Type targetType) { Argument.IsNotNull("targetType", targetType); return _cache.GetFromCacheOrFetch(targetType, () => { var instanceProperties = new InstanceProperties(targetType); _filterCustomizationService.CustomizeInstanceProperties(instanceProperties); return instanceProperties; }); }
public virtual void CustomizeInstanceProperties(InstanceProperties instanceProperties) { Argument.IsNotNull(() => instanceProperties); // Remove Catel properties RemoveProperty(instanceProperties, "BusinessRuleErrorCount"); RemoveProperty(instanceProperties, "BusinessRuleWarningCount"); RemoveProperty(instanceProperties, "FieldErrorCount"); RemoveProperty(instanceProperties, "FieldWarningCount"); RemoveProperty(instanceProperties, "HasErrors"); RemoveProperty(instanceProperties, "HasWarnings"); RemoveProperty(instanceProperties, "IsDirty"); RemoveProperty(instanceProperties, "IsEditable"); RemoveProperty(instanceProperties, "IsInEditSession"); RemoveProperty(instanceProperties, "IsReadOnly"); }