예제 #1
0
        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_Parent.HasValue)
            {
                this.Parent = ((Zetbox.App.Test.RequiredParentNHibernateImpl)OurContext.FindPersistenceObject <Zetbox.App.Test.RequiredParent>(_fk_Parent.Value));
            }
            else
            {
                this.Parent = null;
            }
        }
예제 #2
0
        public override void UpdateParent(string propertyName, IDataObject parentObj)
        {
            switch (propertyName)
            {
            case "Parent":
            {
                var __oldValue = (Zetbox.App.Test.RequiredParentNHibernateImpl)OurContext.AttachAndWrap(this.Proxy.Parent);
                var __newValue = (Zetbox.App.Test.RequiredParentNHibernateImpl)parentObj;
                NotifyPropertyChanging("Parent", __oldValue, __newValue);
                this.Proxy.Parent = __newValue == null ? null : __newValue.Proxy;
                NotifyPropertyChanged("Parent", __oldValue, __newValue);
            }
            break;

            default:
                base.UpdateParent(propertyName, parentObj);
                break;
            }
        }