コード例 #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_Sequence.HasValue)
            {
                this.Sequence = ((Zetbox.App.Base.SequenceNHibernateImpl)OurContext.FindPersistenceObject <Zetbox.App.Base.Sequence>(_fk_Sequence.Value));
            }
            else
            {
                this.Sequence = null;
            }
        }
コード例 #2
0
        public override void UpdateParent(string propertyName, IDataObject parentObj)
        {
            switch (propertyName)
            {
            case "Sequence":
            {
                var __oldValue = (Zetbox.App.Base.SequenceNHibernateImpl)OurContext.AttachAndWrap(this.Proxy.Sequence);
                var __newValue = (Zetbox.App.Base.SequenceNHibernateImpl)parentObj;
                NotifyPropertyChanging("Sequence", __oldValue, __newValue);
                this.Proxy.Sequence = __newValue == null ? null : __newValue.Proxy;
                NotifyPropertyChanged("Sequence", __oldValue, __newValue);
            }
            break;

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