示例#1
0
        public override void NotifyDeleting()
        {
            base.NotifyDeleting();
            if (OnNotifyDeleting_Visual != null)
            {
                OnNotifyDeleting_Visual(this);
            }

            // should fetch && remember parent for Template_has_Visual_RelationEntry
            // FK_Visual_has_Method
            if (Method != null)
            {
                ((NHibernatePersistenceObject)Method).ChildrenToDelete.Add(this);
                ParentsToDelete.Add((NHibernatePersistenceObject)Method);
            }
            // FK_Visual_has_Property
            if (Property != null)
            {
                ((NHibernatePersistenceObject)Property).ChildrenToDelete.Add(this);
                ParentsToDelete.Add((NHibernatePersistenceObject)Property);
            }

            Children.Clear();
            ContextMenu.Clear();
            Method   = null;
            Property = null;
        }
示例#2
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_Method.HasValue)
            {
                this.Method = ((Zetbox.App.Base.MethodNHibernateImpl)OurContext.FindPersistenceObject <Zetbox.App.Base.Method>(_fk_Method.Value));
            }
            else
            {
                this.Method = null;
            }

            if (_fk_Property.HasValue)
            {
                this.Property = ((Zetbox.App.Base.PropertyNHibernateImpl)OurContext.FindPersistenceObject <Zetbox.App.Base.Property>(_fk_Property.Value));
            }
            else
            {
                this.Property = null;
            }
        }
示例#3
0
        public override void UpdateParent(string propertyName, IDataObject parentObj)
        {
            switch (propertyName)
            {
            case "Method":
            {
                var __oldValue = (Zetbox.App.Base.MethodNHibernateImpl)OurContext.AttachAndWrap(this.Proxy.Method);
                var __newValue = (Zetbox.App.Base.MethodNHibernateImpl)parentObj;
                NotifyPropertyChanging("Method", __oldValue, __newValue);
                this.Proxy.Method = __newValue == null ? null : __newValue.Proxy;
                NotifyPropertyChanged("Method", __oldValue, __newValue);
            }
            break;

            case "Property":
            {
                var __oldValue = (Zetbox.App.Base.PropertyNHibernateImpl)OurContext.AttachAndWrap(this.Proxy.Property);
                var __newValue = (Zetbox.App.Base.PropertyNHibernateImpl)parentObj;
                NotifyPropertyChanging("Property", __oldValue, __newValue);
                this.Proxy.Property = __newValue == null ? null : __newValue.Proxy;
                NotifyPropertyChanged("Property", __oldValue, __newValue);
            }
            break;

            default:
                base.UpdateParent(propertyName, parentObj);
                break;
            }
        }
示例#4
0
 public static void GetLabel(Zetbox.App.Base.Property obj, MethodReturnEventArgs <System.String> e)
 {
     e.Result = !string.IsNullOrEmpty(obj.Label) ? obj.Label : obj.Name;
 }
示例#5
0
 public static void GetPropertyTypeString(Zetbox.App.Base.Property obj, Zetbox.API.MethodReturnEventArgs <string> e)
 {
     e.Result = "<Invalid Datatype, please implement Property.GetPropertyTypeString()>";
 }
示例#6
0
 public static void GetPropertyType(Zetbox.App.Base.Property obj, Zetbox.API.MethodReturnEventArgs <System.Type> e)
 {
     throw new NotImplementedException();
 }