public void UpdateKeys(string[] newKeys, bool final) { previous = new ViewModelOid(metamodel, (IObjectSpec)Spec) { Keys = Keys }; Keys = newKeys; // after old key is saved ! IsFinal = final; CacheState(); }
public void UpdateKeys(string[] newKeys, bool final) { previous = new ViewModelOid(metamodel, (IObjectSpec) Spec) {Keys = Keys}; Keys = newKeys; // after old key is saved ! IsFinal = final; CacheState(); }
private INakedObjectAdapter RecreateViewModel(ViewModelOid oid) { string[] keys = oid.Keys; var spec = (IObjectSpec) oid.Spec; INakedObjectAdapter vm = CreateViewModel(spec); vm.Spec.GetFacet<IViewModelFacet>().Populate(keys, vm, nakedObjectManager, injector); nakedObjectManager.UpdateViewModel(vm, keys); return vm; }
private INakedObjectAdapter CreateAdapterForViewModel(object viewModel, IObjectSpec spec) { var oid = new ViewModelOid(metamodel, spec); INakedObjectAdapter adapter = NewAdapterForKnownObject(viewModel, oid); object versionObject = adapter.GetVersion(this); if (versionObject != null) { adapter.OptimisticLock = new ConcurrencyCheckVersion(session.UserName, DateTime.Now, versionObject); } identityMap.AddAdapter(adapter); return adapter; }