public static void CreateFilterModel(Zetbox.App.GUI.SinglePropertyFilterConfiguration obj, MethodReturnEventArgs<IFilterModel> e)
        {
            var mdl = new SingleValueFilterModel();
            mdl.Label = obj.GetLabel();
            mdl.Required = obj.Required;
            mdl.ValueSource = FilterValueSource.FromProperty(obj.Property);

            mdl.ViewModelType = obj.ViewModelDescriptor;
            mdl.RequestedKind = obj.RequestedKind;

            mdl.FilterArguments.Add(new FilterArgumentConfig(obj.Property.GetDetachedValueModel(true), /*cfg.ArgumentViewModel ?? */ obj.Property.ValueModelDescriptor));
            if (obj.Property is StringProperty)
            {
                mdl.Operator = FilterOperators.Contains;
            }
            else if (obj.Property is EnumerationProperty)
            {
                mdl.RefreshOnFilterChanged = true;
            }
            else if (obj.Property is ObjectReferenceProperty)
            {
                mdl.RefreshOnFilterChanged = true;
            }
            e.Result = mdl;
        }
Example #2
0
        public static void CreateNavigator(RelationEnd obj, MethodReturnEventArgs<ObjectReferenceProperty> e)
        {
            Relation rel = obj.AParent ?? obj.BParent;
            RelationEnd other = rel != null ? rel.GetOtherEnd(obj) : null;

            var nav = obj.Context.Create<ObjectReferenceProperty>();
            nav.CategoryTags = String.Empty;
            nav.ObjectClass = obj.Type;
            nav.RelationEnd = obj;
            nav.Module = rel != null ? rel.Module : null;

            if (other != null)
            {
                if (nav.GetIsList())
                {
                    if (nav.RelationEnd.Parent.GetOtherEnd(nav.RelationEnd).HasPersistentOrder)
                    {
                        nav.ValueModelDescriptor = obj.Context.FindPersistenceObject<ViewModelDescriptor>(ViewModelDescriptor_ObjectListModel);
                    }
                    else
                    {
                        nav.ValueModelDescriptor = obj.Context.FindPersistenceObject<ViewModelDescriptor>(ViewModelDescriptor_ObjectCollectionModel);
                    }
                }
                else
                {
                    nav.ValueModelDescriptor = obj.Context.FindPersistenceObject<ViewModelDescriptor>(ViewModelDescriptor_ObjectReferenceModel);
                }

                nav.Name = other.RoleName;
            }

            e.Result = nav;
        }
        public static void GetErrorText(
            StringRangeConstraint obj,
            MethodReturnEventArgs<string> e,
            object constrainedObjectParam,
            object constrainedValueParam)
        {
            if (obj.IsValid(constrainedObjectParam, constrainedValueParam))
            {
                e.Result = null;
            }
            else
            {
                constrainedValueParam = (constrainedValueParam ?? String.Empty);
                int length = constrainedValueParam.ToString().Length;
                StringBuilder result = new StringBuilder();
                if (length < obj.MinLength)
                    result.AppendFormat("{0} should be at least {1} characters long", obj.ConstrainedProperty.Name, obj.MinLength);
                if (obj.MaxLength != null && length > obj.MaxLength)
                    result.AppendFormat("{0} should be at most {1} characters long", obj.ConstrainedProperty.Name, obj.MaxLength);

                if (!String.IsNullOrEmpty(obj.Reason))
                {
                    result.Append(": ");
                    result.Append(obj.Reason);
                }

                e.Result = result.ToString();
            }
        }
Example #4
0
 public static void MakeStaticFile(ImportedFile obj, MethodReturnEventArgs<StaticFile> e)
 {
     var ctx = obj.Context;
     var doc = ctx.Create<StaticFile>();
     MakeInternal(ctx, obj, doc);
     e.Result = doc;
 }
Example #5
0
 public static void GetName(Sequence obj, MethodReturnEventArgs<string> e)
 {
     if (!string.IsNullOrEmpty(obj.Name) && obj.Module != null && !string.IsNullOrEmpty(obj.Module.Name))
     {
         e.Result = "Base.Sequences." + obj.Module.Name + "." + Regex.Replace(obj.Name, "\\W", "_");
     }
 }
        public static void GetErrorText(
            IntegerRangeConstraint obj,
            MethodReturnEventArgs<string> e,
            object constrainedObjectParam,
            object constrainedValueParam)
        {
            if (constrainedValueParam == null)
            {
                e.Result = null;
                return;
            }

            int v = (int)constrainedValueParam;
            if (obj.IsValid(constrainedObjectParam, constrainedValueParam))
            {
                e.Result = null;
            }
            else
            {
                StringBuilder result = new StringBuilder();
                if (v < obj.Min)
                    result.AppendFormat("{0} should be equal or greater than {1}", obj.ConstrainedProperty.Name, obj.Min);
                if (v > obj.Max)
                    result.AppendFormat("{0} should be equal or less than {1}", obj.ConstrainedProperty.Name, obj.Max);

                if (!String.IsNullOrEmpty(obj.Reason))
                {
                    result.Append(": ");
                    result.Append(obj.Reason);
                }

                e.Result = result.ToString();
            }
        }
Example #7
0
        public static void GetRelationType(Relation rel, MethodReturnEventArgs<RelationType> e)
        {
            if (rel == null)
            {
                throw new ArgumentNullException("rel");
            }
            if (rel.A == null)
            {
                throw new ArgumentNullException("rel", "rel.A is null");
            }
            if (rel.B == null)
            {
                throw new ArgumentNullException("rel", "rel.B is null");
            }

            if ((rel.A.Multiplicity.UpperBound() == 1 && rel.B.Multiplicity.UpperBound() > 1)
                || (rel.A.Multiplicity.UpperBound() > 1 && rel.B.Multiplicity.UpperBound() == 1))
            {
                e.Result = RelationType.one_n;
            }
            else if (rel.A.Multiplicity.UpperBound() > 1 && rel.B.Multiplicity.UpperBound() > 1)
            {
                e.Result = RelationType.n_m;
            }
            else if (rel.A.Multiplicity.UpperBound() == 1 && rel.B.Multiplicity.UpperBound() == 1)
            {
                e.Result = RelationType.one_one;
            }
            else
            {
                throw new InvalidOperationException(String.Format("Unable to find out RelationType: {0}:{1}", rel.A.Multiplicity, rel.B.Multiplicity));
            }
        }
 public static void AppliesTo(DayOfWeekWorkScheduleRule obj, MethodReturnEventArgs<System.Boolean> e, System.DateTime date)
 {
     if (obj.CheckValidDate(date))
     {
         e.Result = (int)date.DayOfWeek == (int)obj.DayOfWeek;
     }
 }
 public static void AppliesTo(FixedYearlyCalendarRule obj, MethodReturnEventArgs<System.Boolean> e, System.DateTime date)
 {
     if (obj.CheckValidDate(date))
     {
         e.Result = date.Day == obj.Day && date.Month == obj.Month;
     }
 }
 public static void CreateFilterModel(Zetbox.App.GUI.MonthFilterConfiguration obj, MethodReturnEventArgs<IFilterModel> e, Zetbox.API.IZetboxContext ctx)
 {
     var mdl = MonthValueFilterModel.Create(FrozenContext, obj.GetLabel(), FilterValueSource.FromProperty(obj.Property), obj.IsCurrentMonthDefault ?? false);
     mdl.Required = obj.Required;
     mdl.RefreshOnFilterChanged = obj.RefreshOnFilterChanged;
     e.Result = mdl;
 }
 public static void ToString(ViewModelDescriptor obj, MethodReturnEventArgs<string> e)
 {
     e.Result = string.Format("{0} (default: {1}) [{2}]",
         obj.Description,
         obj.DefaultEditorKind,
         string.IsNullOrWhiteSpace(obj.ViewModelTypeRef) ? "(no type)" : obj.ViewModelTypeRef);
 }
        public static void ToString(ObjectReferenceProperty obj, MethodReturnEventArgs<string> e)
        {
            e.Result = "-> " + e.Result;

            // already handled by base OnToString_Property()
            // ToStringHelper.FixupFloatingObjects(obj, e);
        }
 public static void ToString(ViewModelDescriptor obj, MethodReturnEventArgs<string> e)
 {
     e.Result = string.Format("{0} (default: {1}) [{2}]",
         obj.Description,
         obj.DefaultEditorKind,
         obj.ViewModelRef == null ? "(no type)" : obj.ViewModelRef.ToString());
 }
 public static void GetName(ViewModelDescriptor obj, MethodReturnEventArgs<string> e)
 {
     if (obj.ViewModelRef != null)
     {
         e.Result = string.Format("Gui.ViewModelDescriptors.{0}", Regex.Replace(obj.ViewModelRef.ToTypeName(), @"\W", "_"));
     }
 }
Example #15
0
 public static void HandleBlobChange(StaticFile obj, MethodReturnEventArgs<Blob> e, Blob oldBlob, Blob newBlob)
 {
     if (oldBlob != null && newBlob != oldBlob)
     {
         throw new InvalidOperationException("Changing blob on static files is not allowed");
     }
     e.Result = newBlob;
 }
 public static void GetErrorText(
     NotNullableConstraint obj,
     MethodReturnEventArgs<string> e,
     object constrainedObjectParam,
     object constrainedValueParam)
 {
     e.Result = String.IsNullOrWhiteSpace(obj.Reason) ? Strings.ErrorEmptyValue : String.Format("{0}: {1}", Strings.ErrorEmptyValue, obj.Reason);
 }
 public static void GetPropertyTypeString(ObjectReferenceProperty obj, MethodReturnEventArgs<string> e)
 {
     GetElementTypeString(obj, e);
     if (obj.RelationEnd != null)
     {
         PropertyActions.DecorateParameterType(obj, e, false, obj.GetIsList(), obj.RelationEnd.Parent.GetOtherEnd(obj.RelationEnd).HasPersistentOrder);
     }
 }
Example #18
0
 public static void MakeReadonlyFile(ImportedFile obj, MethodReturnEventArgs<File> e)
 {
     var ctx = obj.Context;
     var doc = ctx.Create<File>();
     MakeInternal(ctx, obj, doc);
     doc.IsFileReadonly = true;
     e.Result = doc;
 }
Example #19
0
 public static void GetName(Property obj, MethodReturnEventArgs<string> e)
 {
     var cls = obj.ObjectClass as ObjectClass;
     if (cls != null)
     {
         e.Result = string.Format("{0}_Properties.{1}", cls.GetName(), obj.Name);
     }
 }
Example #20
0
 public static void ToString(Event obj, MethodReturnEventArgs<System.String> e)
 {
     e.Result = string.Format("{0} - {1}: {2} ({3})",
         obj.IsAllDay ? obj.StartDate.ToShortDateString() : obj.StartDate.ToShortDateString() + " " + obj.StartDate.ToShortTimeString(),
         obj.IsAllDay ? obj.EndDate.ToShortDateString() : obj.EndDate.ToShortDateString() + " " + obj.EndDate.ToShortTimeString(),
         obj.Summary,
         obj.Location);
 }
 public static void AppliesTo(EasterWorkScheduleRule obj, MethodReturnEventArgs<System.Boolean> e, System.DateTime date)
 {
     if (obj.CheckValidDate(date))
     {
         var ostern = GetOstersonntag(date.Year);
         e.Result = ostern.AddDays(obj.Offset ?? 0) == date.Date;
     }
 }
Example #22
0
 /// <summary>
 /// Since floating objects might have no valid/useful ToString() result yet, prefix them with the typename and id.
 /// </summary>
 /// <param name="obj">The current object</param>
 /// <param name="e">The ToString MethodReturnEventArgs.</param>
 internal static void FixupFloatingObjectsToString(IDataObject obj, MethodReturnEventArgs<string> e)
 {
     if (obj.Context != null && obj.Context.IsReadonly) return;
     if (Helper.IsFloatingObject(obj))
     {
         e.Result = String.Format("new {0}(#{1}): {2}", obj.GetType().Name, obj.ID, e.Result);
     }
 }
Example #23
0
 public static void HandleBlobChange(ImportedFile obj, MethodReturnEventArgs<Zetbox.App.Base.Blob> e, Zetbox.App.Base.Blob oldBlob, Zetbox.App.Base.Blob newBlob)
 {
     if (oldBlob != null && newBlob != oldBlob)
     {
         throw new InvalidOperationException("Changing blob on imported files is not allowed");
     }
     e.Result = newBlob;
 }
Example #24
0
 public static void GetSummaryReport(Projekt obj, MethodReturnEventArgs<System.Object> e, string title, Zetbox.App.Base.DateTimeRange range)
 {
     using (var rpt = _rptFactory())
     {
         ProjectReport.Call(rpt);
         rpt.Open("ProjectReport.pdf");
     }
 }
Example #25
0
 public static void HandleBlobChange(at.dasz.DocumentManagement.Document obj, MethodReturnEventArgs<Zetbox.App.Base.Blob> e, Zetbox.App.Base.Blob oldBlob, Zetbox.App.Base.Blob newBlob)
 {
     if (oldBlob != null && !obj.Revisions.Contains(oldBlob))
     {
         obj.Revisions.Add(oldBlob);
     }
     e.Result = newBlob;
 }
 public static void GetErrorText(
     NotNullableConstraint obj,
     MethodReturnEventArgs<string> e,
     object constrainedObjectParam,
     object constrainedValueParam)
 {
     e.Result = String.IsNullOrEmpty(obj.Reason) ? "Wert muss gesetzt sein" : String.Format("Wert muss gesetzt sein: {0}", obj.Reason);
 }
 public static void GetErrorText(
     IsValidIdentifierConstraint obj,
     MethodReturnEventArgs<string> e,
     object constrainedObjectParam,
     object constrainedValueParam)
 {
     e.Result = string.Format("'{0}' is not a valid identifier", constrainedValueParam);
 }
        public static void GetName(ViewModelDescriptor obj, MethodReturnEventArgs<string> e)
        {
            if (!string.IsNullOrWhiteSpace(obj.ViewModelTypeRef) && obj.ViewModelTypeRef != "ERROR")
            {
                var spec = TypeSpec.Parse(obj.ViewModelTypeRef);

                e.Result = string.Format("Gui.ViewModelDescriptors.{0}", Regex.Replace(spec.GetSimpleName(addAssemblyNames: false), @"\W+", "_"));
            }
        }
        public static void GetIsList(ObjectReferenceProperty prop, MethodReturnEventArgs<bool> e)
        {
            if (prop == null) { throw new ArgumentNullException("prop"); }
            RelationEnd relEnd = prop.RelationEnd;
            Relation rel = relEnd.GetParent();
            RelationEnd otherEnd = rel.GetOtherEnd(relEnd);

            e.Result = otherEnd.Multiplicity.UpperBound() > 1;
        }
Example #30
0
 public static void ToString(ViewDescriptor obj, MethodReturnEventArgs<string> e)
 {
     e.Result = String.Format("{0}/{1}: {2}",
         obj.Toolkit,
         obj.ControlKind != null ? obj.ControlKind.Name : "(unknown kind)",
         obj.ControlRef == null
             ? "(none)"
             : obj.ControlRef.ToString());
 }
Example #31
0
        public virtual System.Object GetDefaultValue()
        {
            var e = new MethodReturnEventArgs <System.Object>();

            if (OnGetDefaultValue_DefaultPropertyValue != null)
            {
                OnGetDefaultValue_DefaultPropertyValue(this, e);
            }
            else
            {
                throw new NotImplementedException("No handler registered on DefaultPropertyValue.GetDefaultValue");
            }
            return(e.Result);
        }
Example #32
0
        public override string GetLabel()
        {
            var e = new MethodReturnEventArgs <string>();

            if (OnGetLabel_EnumerationProperty != null)
            {
                OnGetLabel_EnumerationProperty(this, e);
            }
            else
            {
                e.Result = base.GetLabel();
            }
            return(e.Result);
        }
Example #33
0
        public override string GetParameterTypeString()
        {
            var e = new MethodReturnEventArgs <string>();

            if (OnGetParameterTypeString_DateTimeParameter != null)
            {
                OnGetParameterTypeString_DateTimeParameter(this, e);
            }
            else
            {
                e.Result = base.GetParameterTypeString();
            }
            return(e.Result);
        }
Example #34
0
        public override string GetName()
        {
            var e = new MethodReturnEventArgs <string>();

            if (OnGetName_DecimalProperty != null)
            {
                OnGetName_DecimalProperty(this, e);
            }
            else
            {
                e.Result = base.GetName();
            }
            return(e.Result);
        }
Example #35
0
        public override string GetName()
        {
            var e = new MethodReturnEventArgs <string>();

            if (OnGetName_CalculatedObjectReferenceProperty != null)
            {
                OnGetName_CalculatedObjectReferenceProperty(this, e);
            }
            else
            {
                e.Result = base.GetName();
            }
            return(e.Result);
        }
Example #36
0
        public override Zetbox.App.Base.Blob HandleBlobChange(Zetbox.App.Base.Blob oldBlob, Zetbox.App.Base.Blob newBlob)
        {
            var e = new MethodReturnEventArgs <Zetbox.App.Base.Blob>();

            if (OnHandleBlobChange_ImportedFile != null)
            {
                OnHandleBlobChange_ImportedFile(this, e, oldBlob, newBlob);
            }
            else
            {
                e.Result = base.HandleBlobChange(oldBlob, newBlob);
            }
            return(e.Result);
        }
Example #37
0
        public virtual at.dasz.DocumentManagement.StaticFile MakeStaticFile()
        {
            var e = new MethodReturnEventArgs <at.dasz.DocumentManagement.StaticFile>();

            if (OnMakeStaticFile_ImportedFile != null)
            {
                OnMakeStaticFile_ImportedFile(this, e);
            }
            else
            {
                throw new NotImplementedException("No handler registered on ImportedFile.MakeStaticFile");
            }
            return(e.Result);
        }
Example #38
0
        public override System.Object GetDefaultViewModel(Zetbox.API.IZetboxContext dataCtx, System.Object parent)
        {
            var e = new MethodReturnEventArgs <System.Object>();

            if (OnGetDefaultViewModel_NavigationAction != null)
            {
                OnGetDefaultViewModel_NavigationAction(this, e, dataCtx, parent);
            }
            else
            {
                e.Result = base.GetDefaultViewModel(dataCtx, parent);
            }
            return(e.Result);
        }
Example #39
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);
        }
Example #40
0
        public override System.Type GetPropertyType()
        {
            var e = new MethodReturnEventArgs <System.Type>();

            if (OnGetPropertyType_StringProperty != null)
            {
                OnGetPropertyType_StringProperty(this, e);
            }
            else
            {
                e.Result = base.GetPropertyType();
            }
            return(e.Result);
        }
Example #41
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);
        }
Example #42
0
        public override string GetLabel()
        {
            var e = new MethodReturnEventArgs <string>();

            if (OnGetLabel_IntParameter != null)
            {
                OnGetLabel_IntParameter(this, e);
            }
            else
            {
                e.Result = base.GetLabel();
            }
            return(e.Result);
        }
Example #43
0
        public override System.Type GetParameterType()
        {
            var e = new MethodReturnEventArgs <System.Type>();

            if (OnGetParameterType_IntParameter != null)
            {
                OnGetParameterType_IntParameter(this, e);
            }
            else
            {
                e.Result = base.GetParameterType();
            }
            return(e.Result);
        }
Example #44
0
        public override System.Type GetDataType()
        {
            var e = new MethodReturnEventArgs <System.Type>();

            if (OnGetDataType_CompoundObject != null)
            {
                OnGetDataType_CompoundObject(this, e);
            }
            else
            {
                e.Result = base.GetDataType();
            }
            return(e.Result);
        }
Example #45
0
        public override string GetLabel()
        {
            var e = new MethodReturnEventArgs <string>();

            if (OnGetLabel_PropertyFilterConfiguration != null)
            {
                OnGetLabel_PropertyFilterConfiguration(this, e);
            }
            else
            {
                e.Result = base.GetLabel();
            }
            return(e.Result);
        }
Example #46
0
        public override string GetDataTypeString()
        {
            var e = new MethodReturnEventArgs <string>();

            if (OnGetDataTypeString_CompoundObject != null)
            {
                OnGetDataTypeString_CompoundObject(this, e);
            }
            else
            {
                e.Result = base.GetDataTypeString();
            }
            return(e.Result);
        }
Example #47
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);
        }
Example #48
0
        public virtual System.IO.Stream GetStream()
        {
            var e = new MethodReturnEventArgs <System.IO.Stream>();

            if (OnGetStream_Blob != null)
            {
                OnGetStream_Blob(this, e);
            }
            else
            {
                throw new NotImplementedException("No handler registered on Blob.GetStream");
            }
            return(e.Result);
        }
Example #49
0
        public virtual string GetName()
        {
            var e = new MethodReturnEventArgs <string>();

            if (OnGetName_ControlKind != null)
            {
                OnGetName_ControlKind(this, e);
            }
            else
            {
                throw new NotImplementedException("No handler registered on ControlKind.GetName");
            }
            return(e.Result);
        }
Example #50
0
        public override string GetPropertyTypeString()
        {
            var e = new MethodReturnEventArgs <string>();

            if (OnGetPropertyTypeString_ObjectReferencePlaceholderProperty != null)
            {
                OnGetPropertyTypeString_ObjectReferencePlaceholderProperty(this, e);
            }
            else
            {
                e.Result = base.GetPropertyTypeString();
            }
            return(e.Result);
        }
Example #51
0
        public override bool AppliesTo(DateTime date)
        {
            var e = new MethodReturnEventArgs <bool>();

            if (OnAppliesTo_YearlyCalendarRule != null)
            {
                OnAppliesTo_YearlyCalendarRule(this, e, date);
            }
            else
            {
                e.Result = base.AppliesTo(date);
            }
            return(e.Result);
        }
Example #52
0
        public override System.Type GetPropertyType()
        {
            var e = new MethodReturnEventArgs <System.Type>();

            if (OnGetPropertyType_ObjectReferencePlaceholderProperty != null)
            {
                OnGetPropertyType_ObjectReferencePlaceholderProperty(this, e);
            }
            else
            {
                e.Result = base.GetPropertyType();
            }
            return(e.Result);
        }
Example #53
0
        public override string GetElementTypeString()
        {
            var e = new MethodReturnEventArgs <string>();

            if (OnGetElementTypeString_StringProperty != null)
            {
                OnGetElementTypeString_StringProperty(this, e);
            }
            else
            {
                e.Result = base.GetElementTypeString();
            }
            return(e.Result);
        }
Example #54
0
        public virtual string GetMemberName()
        {
            var e = new MethodReturnEventArgs <string>();

            if (OnGetMemberName_ConstraintInvocation != null)
            {
                OnGetMemberName_ConstraintInvocation(this, e);
            }
            else
            {
                throw new NotImplementedException("No handler registered on ConstraintInvocation.GetMemberName");
            }
            return(e.Result);
        }
Example #55
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);
        }
Example #56
0
        public override bool IsValid(System.Object constrainedObject, System.Object constrainedValue)
        {
            var e = new MethodReturnEventArgs <bool>();

            if (OnIsValid_InitOnlyConstraint != null)
            {
                OnIsValid_InitOnlyConstraint(this, e, constrainedObject, constrainedValue);
            }
            else
            {
                e.Result = base.IsValid(constrainedObject, constrainedValue);
            }
            return(e.Result);
        }
Example #57
0
        public virtual Zetbox.API.IDataObject GetObject(Zetbox.API.IZetboxContext ctx)
        {
            var e = new MethodReturnEventArgs <Zetbox.API.IDataObject>();

            if (OnGetObject_AnyReference != null)
            {
                OnGetObject_AnyReference(this, e, ctx);
            }
            else
            {
                throw new NotImplementedException("No handler registered on AnyReference.GetObject");
            }
            return(e.Result);
        }
Example #58
0
        public override string GetErrorText(System.Object constrainedObject, System.Object constrainedValue)
        {
            var e = new MethodReturnEventArgs <string>();

            if (OnGetErrorText_InitOnlyConstraint != null)
            {
                OnGetErrorText_InitOnlyConstraint(this, e, constrainedObject, constrainedValue);
            }
            else
            {
                e.Result = base.GetErrorText(constrainedObject, constrainedValue);
            }
            return(e.Result);
        }
Example #59
0
        public override Zetbox.API.IFilterModel CreateFilterModel()
        {
            var e = new MethodReturnEventArgs <Zetbox.API.IFilterModel>();

            if (OnCreateFilterModel_PropertyFilterConfiguration != null)
            {
                OnCreateFilterModel_PropertyFilterConfiguration(this, e);
            }
            else
            {
                e.Result = base.CreateFilterModel();
            }
            return(e.Result);
        }
Example #60
0
        public override System.Object GetDefaultValue()
        {
            var e = new MethodReturnEventArgs <System.Object>();

            if (OnGetDefaultValue_BoolDefaultValue != null)
            {
                OnGetDefaultValue_BoolDefaultValue(this, e);
            }
            else
            {
                e.Result = base.GetDefaultValue();
            }
            return(e.Result);
        }