public void MakeDirty(BeforeMethodInvocation call)
        {
            IDirtyTracked target = call.Target as IDirtyTracked;
            string        method = call.Method.Name;

            method = method.Replace("set_", "");
            target.SetPropertyDirtyStatus(method, true);
        }
Ejemplo n.º 2
0
        public void DirtyTrackingTest()
        {
            Engine c = new Engine("DirtyTrackingTest");

            c.Configuration.Aspects.Add(new DirtyTrackedAspect());

            DirtyTrackedClass d = c.CreateProxy <DirtyTrackedClass>();


            IDirtyTracked dt = d as IDirtyTracked;

            Assert.IsFalse(dt.IsDirty, "object was dirty");
            d.SomeProp = "Hello";
            Assert.IsTrue(dt.IsDirty, "object not was dirty");

            Assert.IsTrue(dt.GetPropertyDirtyStatus("SomeProp"), "SomeProp was not dirty");
            dt.ClearDirty();

            Assert.IsFalse(dt.GetPropertyDirtyStatus("SomeProp"), "SomeProp was dirty");
        }
        public void ClearDirty(BeforeMethodInvocation call)
        {
            IDirtyTracked target = call.Target as IDirtyTracked;

            target.ClearDirty();
        }