Inheritance: IPropertyCollection
コード例 #1
0
 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--);
         }
     }
 }
コード例 #2
0
        public InstanceProperties GetInstanceProperties(Type targetType)
        {
            Argument.IsNotNull("targetType", targetType);

            return _cache.GetFromCacheOrFetch(targetType, () =>
            {
                var instanceProperties = new InstanceProperties(targetType);
                
                _filterCustomizationService.CustomizeInstanceProperties(instanceProperties);

                return instanceProperties;
            });
        }
コード例 #3
0
        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");
        }