Ejemplo n.º 1
0
        public void MounterManager_RegisterAttachedProperty()
        {
            TargetTypeAttached target = Extension.CreateTarget();

            Assert.AreEqual(4, target.Properties.Count, "Derived target object should have 4 properties.");
            VerifyProperty(target.Properties[0], typeof(TargetType), "Property1", typeof(TargetType), typeof(PropertyType));
            VerifyProperty(target.Properties[1], typeof(TargetType), "Property2", typeof(TargetType), typeof(PropertyType));
            VerifyProperty(target.Properties[2], typeof(Extension), "Property3", typeof(TargetTypeAttached), typeof(PropertyType));
            VerifyProperty(target.Properties[3], typeof(Extension), "Property4", typeof(TargetTypeAttached), typeof(PropertyType));

            Assert.IsNotNull(target.Property1);
            Assert.IsNotNull(target.Property2);
            Assert.IsNotNull(Extension.GetProperty3(target));
            Assert.IsNotNull(Extension.GetProperty4(target));
            Assert.AreEqual(target.Property1, target.Properties[0].GetInstance(target));
            Assert.AreEqual(target.Property2, target.Properties[1].GetInstance(target));
            Assert.AreEqual(Extension.GetProperty3(target), target.Properties[2].GetInstance(target));
            Assert.AreEqual(Extension.GetProperty4(target), target.Properties[3].GetInstance(target));
        }
Ejemplo n.º 2
0
 public static PropertyType GetProperty4(TargetTypeAttached target)
 {
     return(_Property4.GetMember(target));
 }