예제 #1
0
 public virtual void SetObject(Zetbox.API.IDataObject newObj)
 {
     // base.SetObject();
     if (OnSetObject_AnyReference != null)
     {
         OnSetObject_AnyReference(this, newObj);
     }
     else
     {
         throw new NotImplementedException("No handler registered on method AnyReference.SetObject");
     }
 }
예제 #2
0
        public override bool IsValid(Zetbox.API.IDataObject constrainedObject)
        {
            var e = new MethodReturnEventArgs <bool>();

            if (OnIsValid_IndexConstraint != null)
            {
                OnIsValid_IndexConstraint(this, e, constrainedObject);
            }
            else
            {
                e.Result = base.IsValid(constrainedObject);
            }
            return(e.Result);
        }
예제 #3
0
        public override string GetErrorText(Zetbox.API.IDataObject constrainedObject)
        {
            var e = new MethodReturnEventArgs <string>();

            if (OnGetErrorText_IndexConstraint != null)
            {
                OnGetErrorText_IndexConstraint(this, e, constrainedObject);
            }
            else
            {
                e.Result = base.GetErrorText(constrainedObject);
            }
            return(e.Result);
        }
예제 #4
0
        public virtual bool IsValid(Zetbox.API.IDataObject constrainedObject)
        {
            var e = new MethodReturnEventArgs <bool>();

            if (OnIsValid_InstanceConstraint != null)
            {
                OnIsValid_InstanceConstraint(this, e, constrainedObject);
            }
            else
            {
                throw new NotImplementedException("No handler registered on InstanceConstraint.IsValid");
            }
            return(e.Result);
        }
예제 #5
0
        public virtual string GetErrorText(Zetbox.API.IDataObject constrainedObject)
        {
            var e = new MethodReturnEventArgs <string>();

            if (OnGetErrorText_InstanceConstraint != null)
            {
                OnGetErrorText_InstanceConstraint(this, e, constrainedObject);
            }
            else
            {
                throw new NotImplementedException("No handler registered on InstanceConstraint.GetErrorText");
            }
            return(e.Result);
        }
예제 #6
0
 public static void SetObject(AnyReference obj, Zetbox.API.IDataObject newObj)
 {
     if (newObj == null)
     {
         obj.ObjClass = null;
         obj.ObjGuid  = null;
         obj.ObjID    = null;
     }
     else
     {
         var cls = newObj.GetObjectClass(_frozenCtx);
         obj.ObjClass = cls.ExportGuid;
         if (cls.ImplementsIExportable())
         {
             obj.ObjGuid = ((IExportable)newObj).ExportGuid;
             obj.ObjID   = null;
         }
         else
         {
             obj.ObjGuid = null;
             obj.ObjID   = newObj.ID;
         }
     }
 }