Beispiel #1
0
        public static CombinedPropertyScanner CreateDefaultPropertyScanner()
        {
            var result = new CombinedPropertyScanner();

            result.Add(new ReflectionPropertyScanner());
            result.Add(new NotifyPropertyChangedPropertyScanner());
            result.Add(new DictionaryPropertyScanner());
            result.Add(new TypeExtensionsScanner(result));
            result.Add(new CustomPropertyScanner());
            return(result);
        }
Beispiel #2
0
        public void AggregatePropertyClone()
        {
            int cnt     = 0;
            var scanner = new CombinedPropertyScanner();

            scanner.Add(new ReflectionPropertyScanner());
            scanner.Add(new NotifyPropertyChangedPropertyScanner());
            var props = scanner.Scan(typeof(MockView));

            foreach (var prop in props)
            {
                object o1 = new MockView();
                object o2 = new MockView();
                CloneYieldsIndependentPropertiesWithSameObject(prop, o1);
                ClonedPropertyCanChangeObjectIndependently(prop, o1, o2);
                ClonedPropertyCanChangeObjectIndependently(prop, o2, null);
                cnt++;
            }
            Assert.IsTrue(cnt > 0);
        }
Beispiel #3
0
        public Binder(params IPropertyScanner[] propertyScanners)
        {
            var aggregatePropertyScanner = new CombinedPropertyScanner();

            foreach (var ps in propertyScanners)
            {
                var aggps = ps as CombinedPropertyScanner;
                if (aggps != null)
                {
                    foreach (var ps2 in aggps)
                    {
                        aggregatePropertyScanner.Add(ps2);
                    }
                }
                else
                {
                    aggregatePropertyScanner.Add(ps);
                }
            }
            _propertyScanner = aggregatePropertyScanner;
        }