public override void UpdateParent(string propertyName, IDataObject parentObj) { switch (propertyName) { case "Group": { var __oldValue = (Zetbox.App.Base.GroupNHibernateImpl)OurContext.AttachAndWrap(this.Proxy.Group); var __newValue = (Zetbox.App.Base.GroupNHibernateImpl)parentObj; NotifyPropertyChanging("Group", __oldValue, __newValue); this.Proxy.Group = __newValue == null ? null : __newValue.Proxy; NotifyPropertyChanged("Group", __oldValue, __newValue); } break; default: base.UpdateParent(propertyName, parentObj); break; } }
public override void ReloadReferences() { // Do not reload references if the current object has been deleted. // TODO: enable when MemoryContext uses MemoryDataObjects //if (this.ObjectState == DataObjectState.Deleted) return; base.ReloadReferences(); // fix direct object references if (_fk_guid_Group.HasValue) { this.Group = ((Zetbox.App.Base.GroupNHibernateImpl)OurContext.FindPersistenceObject <Zetbox.App.Base.Group>(_fk_guid_Group.Value)); } else if (_fk_Group.HasValue) { this.Group = ((Zetbox.App.Base.GroupNHibernateImpl)OurContext.FindPersistenceObject <Zetbox.App.Base.Group>(_fk_Group.Value)); } else { this.Group = null; } }
public override void ReloadReferences() { // Do not reload references if the current object has been deleted. // TODO: enable when MemoryContext uses MemoryDataObjects //if (this.ObjectState == DataObjectState.Deleted) return; base.ReloadReferences(); // fix direct object references if (_fk_guid_Group.HasValue) this.Group = ((Zetbox.App.Base.GroupNHibernateImpl)OurContext.FindPersistenceObject<Zetbox.App.Base.Group>(_fk_guid_Group.Value)); else if (_fk_Group.HasValue) this.Group = ((Zetbox.App.Base.GroupNHibernateImpl)OurContext.FindPersistenceObject<Zetbox.App.Base.Group>(_fk_Group.Value)); else this.Group = null; }
public override void UpdateParent(string propertyName, IDataObject parentObj) { switch(propertyName) { case "Group": { var __oldValue = (Zetbox.App.Base.GroupNHibernateImpl)OurContext.AttachAndWrap(this.Proxy.Group); var __newValue = (Zetbox.App.Base.GroupNHibernateImpl)parentObj; NotifyPropertyChanging("Group", __oldValue, __newValue); this.Proxy.Group = __newValue == null ? null : __newValue.Proxy; NotifyPropertyChanged("Group", __oldValue, __newValue); } break; default: base.UpdateParent(propertyName, parentObj); break; } }
public override void NotifyDeleting() { base.NotifyDeleting(); if (OnNotifyDeleting_GroupMembership != null) OnNotifyDeleting_GroupMembership(this); // FK_GroupMembership_has_Group if (Group != null) { ((NHibernatePersistenceObject)Group).ChildrenToDelete.Add(this); ParentsToDelete.Add((NHibernatePersistenceObject)Group); } Group = null; }