コード例 #1
0
 private EquivalenceComparer(PropertyNameFilter filter,
                             IDictionary <Type, EquivalenceComparer> nestedComparers,
                             Stack <object> leftStack,
                             Stack <object> rightStack)
 {
     _leftStack       = leftStack;
     _rightStack      = rightStack;
     _propertyFilter  = filter == null ? GlobalFilter : filter.Union(GlobalFilter);
     _nestedComparers = nestedComparers == null
                            ? new Dictionary <Type, EquivalenceComparer>()
                            : new Dictionary <Type, EquivalenceComparer>(nestedComparers);
 }
コード例 #2
0
 public Builder <T> Includes(params Expression <Func <T, object> >[] propertyNames)
 {
     _propertyFilter = _propertyFilter.Union(PropertyNameFilter.ToInclude(propertyNames));
     return(this);
 }
コード例 #3
0
 public Builder <T> Includes(IEnumerable <string> propertyNames)
 {
     typeof(T).RequireProperties(propertyNames);
     _propertyFilter = _propertyFilter.Union(PropertyNameFilter.ToInclude(propertyNames));
     return(this);
 }
コード例 #4
0
 public Builder <T> Excludes(IEnumerable <string> propertyNames)
 {
     _propertyFilter = _propertyFilter.Union(PropertyNameFilter.ToExclude(propertyNames));
     return(this);
 }
コード例 #5
0
 /// <summary>
 /// Internal so as to test. Do not use this constructor in production code
 /// </summary>
 internal EquivalenceComparer(PropertyNameFilter filter,
                              IDictionary <Type, EquivalenceComparer> nestedComparers)
     : this(filter, nestedComparers, new Stack <object>(), new Stack <object>())
 {
 }
コード例 #6
0
 public static void ClearGlobalFilter()
 {
     GlobalFilter = PropertyNameFilter.NoFilter;
 }
コード例 #7
0
 public PropertiesSetter(IDictionary <Type, object> values, PropertyNameFilter propertyFilter)
 {
     _propertyFilter           = propertyFilter;
     _registeredDataGenerators = CreateDataGenerators(values);
 }
コード例 #8
0
 public static PropertiesSetter DefaultFilteredSetter(PropertyNameFilter filter)
 {
     return(new PropertiesSetter(CreateDefaultPropertyValues(), filter));
 }