/// <summary> /// For use by the ProxyGen, since the users of it know only about the base type used /// to generate the proxy. The struct used internally is not exposed, and so users /// of proxy classes could not write a ModificationDelegate which works on an argument /// whose type is that hidden struct. /// </summary> public void Commute(Action perform) { Shield.EnlistStrictCommute(perform, this); RaiseChanged(); }
/// <summary> /// The action is performed just before commit, and reads the latest /// data. If it conflicts, only it is retried. If it succeeds, /// we (try to) commit with the same write stamp along with it. /// But, if you access this Shielded, it gets executed directly in this transaction. /// The Changed event is raised only when the commute is enlisted, and not /// when (and every time, given possible repetitions..) it executes. /// </summary> public void Commute(ModificationDelegate perform) { Shield.EnlistStrictCommute( () => perform(ref PrepareForWriting(true).Value), this); RaiseChanged(); }