Example #1
0
        private string FetchParentNameOrDefault()
        {
            var __result = Proxy.ParentName;

            if (_ParentName_IsDirty && OnParentName_Getter != null)
            {
                var __e = new PropertyGetterEventArgs <string>(__result);
                OnParentName_Getter(this, __e);
                _ParentName_IsDirty = false;
                __result            = Proxy.ParentName = __e.Result;
            }
            return(__result);
        }
Example #2
0
 public static void get_TotalNet(Quote obj, PropertyGetterEventArgs <decimal> e)
 {
     if (obj is PurchaseQuote)
     {
         var pQuote = (PurchaseQuote)obj;
         e.Result = pQuote.Items.Sum(i => i.AmountNet);
     }
     else if (obj is SalesQuote)
     {
         var sQuote = (SalesQuote)obj;
         e.Result = sQuote.Items.Sum(i => i.AmountNet);
     }
 }
Example #3
0
        public static void get_CodeTemplate(Property obj, PropertyGetterEventArgs <string> e)
        {
            StringBuilder sb = new StringBuilder();

            string type     = obj.ObjectClass != null ? obj.ObjectClass.Name : "<<TYPE>>";
            string propType = obj.GetPropertyTypeString();

            sb.AppendFormat("[Invocation]\npublic static void {0}_{1}({2} obj, {3}<{4}> e)\n{{\n}}\n\n", "get", obj.Name, type, "PropertyGetterEventArgs", propType);
            sb.AppendFormat("[Invocation]\npublic static void {0}_{1}({2} obj, {3}<{4}> e)\n{{\n}}\n\n", "preSet", obj.Name, type, "PropertyPreSetterEventArgs", propType);
            sb.AppendFormat("[Invocation]\npublic static void {0}_{1}({2} obj, {3}<{4}> e)\n{{\n}}\n\n", "postSet", obj.Name, type, "PropertyPostSetterEventArgs", propType);
            sb.AppendFormat("[Invocation]\npublic static void {0}_{1}({2} obj, {3} e)\n{{\n\te.IsValid = obj.{1} == ...;\n\te.Error = e.IsValid ? string.Empty : \"<Error>\";\n}}\n\n", "isValid", obj.Name, type, "PropertyIsValidEventArgs");

            e.Result = sb.ToString();
        }
Example #4
0
        public static void get_CodeTemplate(Property obj, PropertyGetterEventArgs<string> e)
        {
            StringBuilder sb = new StringBuilder();

            string type = obj.ObjectClass != null ? obj.ObjectClass.Name : "<<TYPE>>";
            string propType = obj.GetPropertyTypeString();

            sb.AppendFormat("[Invocation]\npublic static void {0}_{1}({2} obj, {3}<{4}> e)\n{{\n}}\n\n", "get", obj.Name, type, "PropertyGetterEventArgs", propType);
            sb.AppendFormat("[Invocation]\npublic static void {0}_{1}({2} obj, {3}<{4}> e)\n{{\n}}\n\n", "preSet", obj.Name, type, "PropertyPreSetterEventArgs", propType);
            sb.AppendFormat("[Invocation]\npublic static void {0}_{1}({2} obj, {3}<{4}> e)\n{{\n}}\n\n", "postSet", obj.Name, type, "PropertyPostSetterEventArgs", propType);
            sb.AppendFormat("[Invocation]\npublic static void {0}_{1}({2} obj, {3} e)\n{{\n\te.IsValid = obj.{1} == ...;\n\te.Error = e.IsValid ? string.Empty : \"<Error>\";\n}}\n\n", "isValid", obj.Name, type, "PropertyIsValidEventArgs");

            e.Result = sb.ToString();
        }
Example #5
0
        public static void get_CodeTemplate(ObjectClass obj, PropertyGetterEventArgs <string> e)
        {
            StringBuilder sb = new StringBuilder();

            string type = obj.Name;

            sb.AppendFormat("[Invocation]\npublic static void ToString({0} obj, MethodReturnEventArgs<string> e)\n{{\n}}\n\n", type);
            sb.AppendFormat("[Invocation]\npublic static void NotifyPreSave({0} obj)\n{{\n}}\n\n", type);
            sb.AppendFormat("[Invocation]\npublic static void NotifyPostSave({0} obj)\n{{\n}}\n\n", type);
            sb.AppendFormat("[Invocation]\npublic static void NotifyCreated({0} obj)\n{{\n}}\n\n", type);
            sb.AppendFormat("[Invocation]\npublic static void NotifyDeleting({0} obj)\n{{\n}}\n\n", type);
            sb.AppendFormat("[Invocation]\npublic static void ObjectIsValid({0} obj, ObjectIsValidEventArgs e)\n{{\n}}\n\n", type);

            e.Result = sb.ToString();
        }
Example #6
0
        public static void get_CodeTemplate(ObjectClass obj, PropertyGetterEventArgs<string> e)
        {
            StringBuilder sb = new StringBuilder();

            string type = obj.Name;

            sb.AppendFormat("[Invocation]\npublic static void ToString({0} obj, MethodReturnEventArgs<string> e)\n{{\n}}\n\n", type);
            sb.AppendFormat("[Invocation]\npublic static void NotifyPreSave({0} obj)\n{{\n}}\n\n", type);
            sb.AppendFormat("[Invocation]\npublic static void NotifyPostSave({0} obj)\n{{\n}}\n\n", type);
            sb.AppendFormat("[Invocation]\npublic static void NotifyCreated({0} obj)\n{{\n}}\n\n", type);
            sb.AppendFormat("[Invocation]\npublic static void NotifyDeleting({0} obj)\n{{\n}}\n\n", type);
            sb.AppendFormat("[Invocation]\npublic static void ObjectIsValid({0} obj, ObjectIsValidEventArgs e)\n{{\n}}\n\n", type);

            e.Result = sb.ToString();
        }
Example #7
0
        public static void get_CodeTemplate(Method obj, PropertyGetterEventArgs <string> e)
        {
            StringBuilder sb = new StringBuilder();

            string objParameter;

            if (obj.ObjectClass != null)
            {
                objParameter = string.Format("{0} obj", obj.ObjectClass.Name);
            }
            else
            {
                objParameter = "<<TYPE>> obj";
            }

            sb.AppendFormat("[Invocation]\npublic static void {0}({1}", obj.Name, objParameter);

            var returnParam = obj.GetReturnParameter();

            if (returnParam != null)
            {
                sb.AppendFormat(", MethodReturnEventArgs<{0}> e", returnParam.GetParameterTypeString());
            }

            foreach (var param in obj.Parameter.Where(p => !p.IsReturnParameter))
            {
                sb.AppendFormat(", {0} {1}",
                                param.GetParameterTypeString(),
                                param.Name);
            }

            sb.AppendLine(")\n{\n}");

            sb.AppendLine();
            sb.AppendFormat("[Invocation]\npublic static void {0}CanExec({1}, MethodReturnEventArgs<bool> e)\n{{\n}}\n", obj.Name, objParameter);

            sb.AppendLine();
            sb.AppendFormat("[Invocation]\npublic static void {0}CanExecReason({1}, MethodReturnEventArgs<string> e)\n{{\n}}\n", obj.Name, objParameter);

            e.Result = sb.ToString();
        }
Example #8
0
        public static void get_CodeTemplate(Method obj, PropertyGetterEventArgs<string> e)
        {
            StringBuilder sb = new StringBuilder();

            string objParameter;
            if (obj.ObjectClass != null)
            {
                objParameter = string.Format("{0} obj", obj.ObjectClass.Name);
            }
            else
            {
                objParameter = "<<TYPE>> obj";
            }

            sb.AppendFormat("[Invocation]\npublic static void {0}({1}", obj.Name, objParameter);

            var returnParam = obj.GetReturnParameter();
            if (returnParam != null)
            {
                sb.AppendFormat(", MethodReturnEventArgs<{0}> e", returnParam.GetParameterTypeString());
            }

            foreach (var param in obj.Parameter.Where(p => !p.IsReturnParameter))
            {
                sb.AppendFormat(", {0} {1}",
                    param.GetParameterTypeString(),
                    param.Name);
            }

            sb.AppendLine(")\n{\n}");

            sb.AppendLine();
            sb.AppendFormat("[Invocation]\npublic static void {0}CanExec({1}, MethodReturnEventArgs<bool> e)\n{{\n}}\n", obj.Name, objParameter);

            sb.AppendLine();
            sb.AppendFormat("[Invocation]\npublic static void {0}CanExecReason({1}, MethodReturnEventArgs<string> e)\n{{\n}}\n", obj.Name, objParameter);

            e.Result = sb.ToString();
        }
Example #9
0
 public static void get_Description(AccessControl obj, PropertyGetterEventArgs<string> e)
 {
     if (obj is GroupMembership)
     {
         var grp = (GroupMembership)obj;
         e.Result = string.Format("Group {0} has {1} rights", grp.Group != null ? grp.Group.Name : "<null>", obj.Rights);
     }
     else if (obj is RoleMembership)
     {
         var role = (RoleMembership)obj;
         var navigators = new List<string>();
         ObjectClass nextType = obj.ObjectClass;
         foreach (var rel in role.Relations)
         {
             if (rel == null)
             {
                 // Only during dehydration - fix this call!
                 continue;
             }
             if (rel.A != null && rel.A.Type == nextType)
             {
                 navigators.Add(rel.A.Navigator != null ? rel.A.Navigator.Name : "<?>");
                 nextType = rel.B.Type;
             }
             else if (rel.B != null && rel.B.Type == nextType)
             {
                 navigators.Add(rel.B.Navigator != null ? rel.B.Navigator.Name : "<?>");
                 nextType = rel.A.Type;
             }
             else
             {
                 navigators.Add("<?>");
             }
         }
         e.Result = string.Format("{0} has {1} rights", string.Join(".", navigators), obj.Rights);
     }
 }
Example #10
0
 public static void get_VAT(Transaction obj, PropertyGetterEventArgs <decimal> e)
 {
     if (obj.Receipts.Count == 0)
     {
         e.Result = 0;
     }
     else
     {
         var receipts = obj.Receipts.Where(r => r.Receipt != null).Select(r => r.Receipt).ToList();
         if (receipts.Sum(r => r.Total) == obj.Amount)
         {
             e.Result = Math.Round(receipts.Sum(r => r.Total - r.TotalNet), 2);
         }
         else if (receipts.Sum(r => r.Total) != 0 && receipts.Sum(r => r.TotalNet) != 0)
         {
             var vatp = receipts.Sum(r => r.Total) / receipts.Sum(r => r.TotalNet);
             e.Result = Math.Round(obj.Amount - (obj.Amount / vatp), 2);
         }
         else
         {
             e.Result = 0;
         }
     }
 }
        public Zetbox.API.Async.ZbTask<Zetbox.App.SchemaMigration.SourceTable> TriggerFetchSourceTableAsync()
        {
            if (_triggerFetchSourceTableTask != null) return _triggerFetchSourceTableTask;

            if (_fk_SourceTable.HasValue)
                _triggerFetchSourceTableTask = Context.FindAsync<Zetbox.App.SchemaMigration.SourceTable>(_fk_SourceTable.Value);
            else
                _triggerFetchSourceTableTask = new Zetbox.API.Async.ZbTask<Zetbox.App.SchemaMigration.SourceTable>(Zetbox.API.Async.ZbTask.Synchron, () => null);

            _triggerFetchSourceTableTask.OnResult(t =>
            {
                if (OnSourceTable_Getter != null)
                {
                    var e = new PropertyGetterEventArgs<Zetbox.App.SchemaMigration.SourceTable>(t.Result);
                    OnSourceTable_Getter(this, e);
                    t.Result = e.Result;
                }
            });

            return _triggerFetchSourceTableTask;
        }
Example #12
0
 public static void get_TotalDays(DateTimeRange obj, PropertyGetterEventArgs <int?> e)
 {
     e.Result = obj.From.HasValue && obj.Thru.HasValue ? (int?)((obj.Thru.Value - obj.From.Value).TotalDays) : null;
 }
        public Zetbox.API.Async.ZbTask<Zetbox.App.Base.DataType> TriggerFetchConstrainedAsync()
        {
            if (_triggerFetchConstrainedTask != null) return _triggerFetchConstrainedTask;

            if (_fk_Constrained.HasValue)
                _triggerFetchConstrainedTask = Context.FindAsync<Zetbox.App.Base.DataType>(_fk_Constrained.Value);
            else
                _triggerFetchConstrainedTask = new Zetbox.API.Async.ZbTask<Zetbox.App.Base.DataType>(Zetbox.API.Async.ZbTask.Synchron, () => null);

            _triggerFetchConstrainedTask.OnResult(t =>
            {
                if (OnConstrained_Getter != null)
                {
                    var e = new PropertyGetterEventArgs<Zetbox.App.Base.DataType>(t.Result);
                    OnConstrained_Getter(this, e);
                    t.Result = e.Result;
                }
            });

            return _triggerFetchConstrainedTask;
        }
Example #14
0
 public static void get_AufwandGes(Projekt obj, PropertyGetterEventArgs<double?> e)
 {
     e.Result = obj.Tasks.Sum(t => t.Aufwand);
 }
Example #15
0
 public static void get_Parent(RelationEnd relEnd, PropertyGetterEventArgs<Relation> e)
 {
     e.Result = relEnd.AParent ?? relEnd.BParent;
 }
Example #16
0
 public static void get_ParentName(SecurityTestChild obj, PropertyGetterEventArgs<string> e)
 {
     e.Result = obj.Parent != null ? obj.Parent.Name : string.Empty;
 }
 private string FetchCodeTemplateOrDefault()
 {
    var __result = Proxy.CodeTemplate;
     if (_CodeTemplate_IsDirty && OnCodeTemplate_Getter != null)
     {
         var __e = new PropertyGetterEventArgs<string>(__result);
         OnCodeTemplate_Getter(this, __e);
         _CodeTemplate_IsDirty = false;
         __result = Proxy.CodeTemplate = __e.Result;
     }
     return __result;
 }
Example #18
0
 public static void get_OverPayment(Transaction obj, PropertyGetterEventArgs <decimal> e)
 {
     e.Result = obj.Amount - obj.Receipts.Sum(r => r.Amount);
 }
Example #19
0
 public static void get_Transfered(Transaction obj, PropertyGetterEventArgs <Account> e)
 {
     e.Result = (obj.TransferedFrom != null ? obj.TransferedFrom.Account : null) ?? (obj.TransferedTo != null ? obj.TransferedTo.Account : null);
 }
        public Zetbox.API.Async.ZbTask<Zetbox.App.Base.EnumerationEntry> TriggerFetchDestinationValueAsync()
        {
            if (_triggerFetchDestinationValueTask != null) return _triggerFetchDestinationValueTask;

            if (_fk_DestinationValue.HasValue)
                _triggerFetchDestinationValueTask = Context.FindAsync<Zetbox.App.Base.EnumerationEntry>(_fk_DestinationValue.Value);
            else
                _triggerFetchDestinationValueTask = new Zetbox.API.Async.ZbTask<Zetbox.App.Base.EnumerationEntry>(Zetbox.API.Async.ZbTask.Synchron, () => null);

            _triggerFetchDestinationValueTask.OnResult(t =>
            {
                if (OnDestinationValue_Getter != null)
                {
                    var e = new PropertyGetterEventArgs<Zetbox.App.Base.EnumerationEntry>(t.Result);
                    OnDestinationValue_Getter(this, e);
                    t.Result = e.Result;
                }
            });

            return _triggerFetchDestinationValueTask;
        }
Example #21
0
        public Zetbox.API.Async.ZbTask<Zetbox.App.Base.SequenceData> TriggerFetchDataAsync()
        {
            if (_triggerFetchDataTask != null) return _triggerFetchDataTask;

            if (_fk_Data.HasValue)
                _triggerFetchDataTask = Context.FindAsync<Zetbox.App.Base.SequenceData>(_fk_Data.Value);
            else
                _triggerFetchDataTask = new Zetbox.API.Async.ZbTask<Zetbox.App.Base.SequenceData>(Zetbox.API.Async.ZbTask.Synchron, () => null);

            _triggerFetchDataTask.OnResult(t =>
            {
                if (OnData_Getter != null)
                {
                    var e = new PropertyGetterEventArgs<Zetbox.App.Base.SequenceData>(t.Result);
                    OnData_Getter(this, e);
                    t.Result = e.Result;
                }
            });

            return _triggerFetchDataTask;
        }
Example #22
0
 public static void get_OpenAmount(Receipt obj, PropertyGetterEventArgs <decimal> e)
 {
     e.Result = obj.Total - obj.PaymentAmount;
 }
Example #23
0
 public static void get_Parent(RelationEnd relEnd, PropertyGetterEventArgs <Relation> e)
 {
     e.Result = relEnd.AParent ?? relEnd.BParent;
 }
Example #24
0
 public static void get_ParentName(SecurityTestChild obj, PropertyGetterEventArgs <string> e)
 {
     e.Result = obj.Parent != null ? obj.Parent.Name : string.Empty;
 }
        public Zetbox.API.Async.ZbTask<Zetbox.App.Test.One_to_N_relations_One> TriggerFetchOneSideAsync()
        {
            if (_triggerFetchOneSideTask != null) return _triggerFetchOneSideTask;

            if (_fk_OneSide.HasValue)
                _triggerFetchOneSideTask = Context.FindAsync<Zetbox.App.Test.One_to_N_relations_One>(_fk_OneSide.Value);
            else
                _triggerFetchOneSideTask = new Zetbox.API.Async.ZbTask<Zetbox.App.Test.One_to_N_relations_One>(Zetbox.API.Async.ZbTask.Synchron, () => null);

            _triggerFetchOneSideTask.OnResult(t =>
            {
                if (OnOneSide_Getter != null)
                {
                    var e = new PropertyGetterEventArgs<Zetbox.App.Test.One_to_N_relations_One>(t.Result);
                    OnOneSide_Getter(this, e);
                    t.Result = e.Result;
                }
            });

            return _triggerFetchOneSideTask;
        }
        public Zetbox.API.Async.ZbTask<Zetbox.App.GUI.ViewModelDescriptor> TriggerFetchViewModelDescriptorAsync()
        {
            if (_triggerFetchViewModelDescriptorTask != null) return _triggerFetchViewModelDescriptorTask;

            if (_fk_ViewModelDescriptor.HasValue)
                _triggerFetchViewModelDescriptorTask = Context.FindAsync<Zetbox.App.GUI.ViewModelDescriptor>(_fk_ViewModelDescriptor.Value);
            else
                _triggerFetchViewModelDescriptorTask = new Zetbox.API.Async.ZbTask<Zetbox.App.GUI.ViewModelDescriptor>(Zetbox.API.Async.ZbTask.Synchron, () => null);

            _triggerFetchViewModelDescriptorTask.OnResult(t =>
            {
                if (OnViewModelDescriptor_Getter != null)
                {
                    var e = new PropertyGetterEventArgs<Zetbox.App.GUI.ViewModelDescriptor>(t.Result);
                    OnViewModelDescriptor_Getter(this, e);
                    t.Result = e.Result;
                }
            });

            return _triggerFetchViewModelDescriptorTask;
        }
Example #27
0
 public static void get_TotalDays(DateTimeRange obj, PropertyGetterEventArgs<int?> e)
 {
     e.Result = obj.From.HasValue && obj.Thru.HasValue ? (int?)((obj.Thru.Value - obj.From.Value).TotalDays) : null;
 }
        public Zetbox.API.Async.ZbTask<Zetbox.App.Base.ObjectClass> TriggerFetchTypeAsync()
        {
            if (_triggerFetchTypeTask != null) return _triggerFetchTypeTask;

            if (_fk_Type.HasValue)
                _triggerFetchTypeTask = Context.FindAsync<Zetbox.App.Base.ObjectClass>(_fk_Type.Value);
            else
                _triggerFetchTypeTask = new Zetbox.API.Async.ZbTask<Zetbox.App.Base.ObjectClass>(Zetbox.API.Async.ZbTask.Synchron, () => null);

            _triggerFetchTypeTask.OnResult(t =>
            {
                if (OnType_Getter != null)
                {
                    var e = new PropertyGetterEventArgs<Zetbox.App.Base.ObjectClass>(t.Result);
                    OnType_Getter(this, e);
                    t.Result = e.Result;
                }
            });

            return _triggerFetchTypeTask;
        }
Example #29
0
        public Zetbox.API.Async.ZbTask<at.dasz.DocumentManagement.Excerpt> TriggerFetchExcerptAsync()
        {
            if (_triggerFetchExcerptTask != null) return _triggerFetchExcerptTask;

            if (_fk_Excerpt.HasValue)
                _triggerFetchExcerptTask = Context.FindAsync<at.dasz.DocumentManagement.Excerpt>(_fk_Excerpt.Value);
            else
                _triggerFetchExcerptTask = new Zetbox.API.Async.ZbTask<at.dasz.DocumentManagement.Excerpt>(Zetbox.API.Async.ZbTask.Synchron, () => null);

            _triggerFetchExcerptTask.OnResult(t =>
            {
                if (OnExcerpt_Getter != null)
                {
                    var e = new PropertyGetterEventArgs<at.dasz.DocumentManagement.Excerpt>(t.Result);
                    OnExcerpt_Getter(this, e);
                    t.Result = e.Result;
                }
            });

            return _triggerFetchExcerptTask;
        }
        public Zetbox.API.Async.ZbTask<Zetbox.App.Base.Relation> TriggerFetchAParentAsync()
        {
            if (_triggerFetchAParentTask != null) return _triggerFetchAParentTask;

            if (_fk_AParent.HasValue)
                _triggerFetchAParentTask = Context.FindAsync<Zetbox.App.Base.Relation>(_fk_AParent.Value);
            else
                _triggerFetchAParentTask = new Zetbox.API.Async.ZbTask<Zetbox.App.Base.Relation>(Zetbox.API.Async.ZbTask.Synchron, () => null);

            _triggerFetchAParentTask.OnResult(t =>
            {
                if (OnAParent_Getter != null)
                {
                    var e = new PropertyGetterEventArgs<Zetbox.App.Base.Relation>(t.Result);
                    OnAParent_Getter(this, e);
                    t.Result = e.Result;
                }
            });

            return _triggerFetchAParentTask;
        }
Example #31
0
        public Zetbox.API.Async.ZbTask<Zetbox.App.Test.TestCustomObject> TriggerFetchTestCustomObjects_One_NavAsync()
        {
            if (_triggerFetchTestCustomObjects_One_NavTask != null) return _triggerFetchTestCustomObjects_One_NavTask;

            if (_fk_TestCustomObjects_One_Nav.HasValue)
                _triggerFetchTestCustomObjects_One_NavTask = Context.FindAsync<Zetbox.App.Test.TestCustomObject>(_fk_TestCustomObjects_One_Nav.Value);
            else
                _triggerFetchTestCustomObjects_One_NavTask = new Zetbox.API.Async.ZbTask<Zetbox.App.Test.TestCustomObject>(Zetbox.API.Async.ZbTask.Synchron, () => null);

            _triggerFetchTestCustomObjects_One_NavTask.OnResult(t =>
            {
                if (OnTestCustomObjects_One_Nav_Getter != null)
                {
                    var e = new PropertyGetterEventArgs<Zetbox.App.Test.TestCustomObject>(t.Result);
                    OnTestCustomObjects_One_Nav_Getter(this, e);
                    t.Result = e.Result;
                }
            });

            return _triggerFetchTestCustomObjects_One_NavTask;
        }
Example #32
0
 public static void get_IsActive(WFInstance obj, PropertyGetterEventArgs <bool> e)
 {
     e.Result = obj.Workflow != null && obj.States.Any(s => s.IsActive);
 }
        public Zetbox.API.Async.ZbTask<Zetbox.App.Calendar.WorkSchedule> TriggerFetchBaseWorkScheduleAsync()
        {
            if (_triggerFetchBaseWorkScheduleTask != null) return _triggerFetchBaseWorkScheduleTask;

            if (_fk_BaseWorkSchedule.HasValue)
                _triggerFetchBaseWorkScheduleTask = Context.FindAsync<Zetbox.App.Calendar.WorkSchedule>(_fk_BaseWorkSchedule.Value);
            else
                _triggerFetchBaseWorkScheduleTask = new Zetbox.API.Async.ZbTask<Zetbox.App.Calendar.WorkSchedule>(Zetbox.API.Async.ZbTask.Synchron, () => null);

            _triggerFetchBaseWorkScheduleTask.OnResult(t =>
            {
                if (OnBaseWorkSchedule_Getter != null)
                {
                    var e = new PropertyGetterEventArgs<Zetbox.App.Calendar.WorkSchedule>(t.Result);
                    OnBaseWorkSchedule_Getter(this, e);
                    t.Result = e.Result;
                }
            });

            return _triggerFetchBaseWorkScheduleTask;
        }
Example #34
0
 public static void get_IsActive(State obj, PropertyGetterEventArgs <bool> e)
 {
     e.Result = obj.LeftOn == null;
 }
Example #35
0
 public static void get_CalculatedEnumeration(TestObjClass obj, PropertyGetterEventArgs<TestEnum> e)
 {
     e.Result = obj.ID % 2 == 0
         ? TestEnum.First
         : TestEnum.Second;
 }
        public Zetbox.API.Async.ZbTask<Zetbox.App.Base.CompoundObject> TriggerFetchCompoundObjectDefinitionAsync()
        {
            if (_triggerFetchCompoundObjectDefinitionTask != null) return _triggerFetchCompoundObjectDefinitionTask;

            if (_fk_CompoundObjectDefinition.HasValue)
                _triggerFetchCompoundObjectDefinitionTask = Context.FindAsync<Zetbox.App.Base.CompoundObject>(_fk_CompoundObjectDefinition.Value);
            else
                _triggerFetchCompoundObjectDefinitionTask = new Zetbox.API.Async.ZbTask<Zetbox.App.Base.CompoundObject>(Zetbox.API.Async.ZbTask.Synchron, () => null);

            _triggerFetchCompoundObjectDefinitionTask.OnResult(t =>
            {
                if (OnCompoundObjectDefinition_Getter != null)
                {
                    var e = new PropertyGetterEventArgs<Zetbox.App.Base.CompoundObject>(t.Result);
                    OnCompoundObjectDefinition_Getter(this, e);
                    t.Result = e.Result;
                }
            });

            return _triggerFetchCompoundObjectDefinitionTask;
        }
        public Zetbox.API.Async.ZbTask<Zetbox.App.GUI.ControlKind> TriggerFetchRequestedKindAsync()
        {
            if (_triggerFetchRequestedKindTask != null) return _triggerFetchRequestedKindTask;

            if (_fk_RequestedKind.HasValue)
                _triggerFetchRequestedKindTask = Context.FindAsync<Zetbox.App.GUI.ControlKind>(_fk_RequestedKind.Value);
            else
                _triggerFetchRequestedKindTask = new Zetbox.API.Async.ZbTask<Zetbox.App.GUI.ControlKind>(Zetbox.API.Async.ZbTask.Synchron, () => null);

            _triggerFetchRequestedKindTask.OnResult(t =>
            {
                if (OnRequestedKind_Getter != null)
                {
                    var e = new PropertyGetterEventArgs<Zetbox.App.GUI.ControlKind>(t.Result);
                    OnRequestedKind_Getter(this, e);
                    t.Result = e.Result;
                }
            });

            return _triggerFetchRequestedKindTask;
        }
        public Zetbox.API.Async.ZbTask<Zetbox.App.GUI.NavigationScreen> TriggerFetchRootScreenAsync()
        {
            if (_triggerFetchRootScreenTask != null) return _triggerFetchRootScreenTask;

            if (_fk_RootScreen.HasValue)
                _triggerFetchRootScreenTask = Context.FindAsync<Zetbox.App.GUI.NavigationScreen>(_fk_RootScreen.Value);
            else
                _triggerFetchRootScreenTask = new Zetbox.API.Async.ZbTask<Zetbox.App.GUI.NavigationScreen>(Zetbox.API.Async.ZbTask.Synchron, () => null);

            _triggerFetchRootScreenTask.OnResult(t =>
            {
                if (OnRootScreen_Getter != null)
                {
                    var e = new PropertyGetterEventArgs<Zetbox.App.GUI.NavigationScreen>(t.Result);
                    OnRootScreen_Getter(this, e);
                    t.Result = e.Result;
                }
            });

            return _triggerFetchRootScreenTask;
        }
        public Zetbox.API.Async.ZbTask<Zetbox.App.Base.Identity> TriggerFetchCreatedByAsync()
        {
            if (_triggerFetchCreatedByTask != null) return _triggerFetchCreatedByTask;

            if (_fk_CreatedBy.HasValue)
                _triggerFetchCreatedByTask = Context.FindAsync<Zetbox.App.Base.Identity>(_fk_CreatedBy.Value);
            else
                _triggerFetchCreatedByTask = new Zetbox.API.Async.ZbTask<Zetbox.App.Base.Identity>(Zetbox.API.Async.ZbTask.Synchron, () => null);

            _triggerFetchCreatedByTask.OnResult(t =>
            {
                if (OnCreatedBy_Getter != null)
                {
                    var e = new PropertyGetterEventArgs<Zetbox.App.Base.Identity>(t.Result);
                    OnCreatedBy_Getter(this, e);
                    t.Result = e.Result;
                }
            });

            return _triggerFetchCreatedByTask;
        }
Example #40
0
        public Zetbox.API.Async.ZbTask<Zetbox.App.Projekte.Mitarbeiter> TriggerFetchMitarbeiterAsync()
        {
            if (_triggerFetchMitarbeiterTask != null) return _triggerFetchMitarbeiterTask;

            if (_fk_Mitarbeiter.HasValue)
                _triggerFetchMitarbeiterTask = Context.FindAsync<Zetbox.App.Projekte.Mitarbeiter>(_fk_Mitarbeiter.Value);
            else
                _triggerFetchMitarbeiterTask = new Zetbox.API.Async.ZbTask<Zetbox.App.Projekte.Mitarbeiter>(Zetbox.API.Async.ZbTask.Synchron, () => null);

            _triggerFetchMitarbeiterTask.OnResult(t =>
            {
                if (OnMitarbeiter_Getter != null)
                {
                    var e = new PropertyGetterEventArgs<Zetbox.App.Projekte.Mitarbeiter>(t.Result);
                    OnMitarbeiter_Getter(this, e);
                    t.Result = e.Result;
                }
            });

            return _triggerFetchMitarbeiterTask;
        }
        public Zetbox.API.Async.ZbTask<Zetbox.App.Base.ObjectReferenceProperty> TriggerFetchNavigatorAsync()
        {
            if (_triggerFetchNavigatorTask != null) return _triggerFetchNavigatorTask;

            if (_fk_Navigator.HasValue)
                _triggerFetchNavigatorTask = Context.FindAsync<Zetbox.App.Base.ObjectReferenceProperty>(_fk_Navigator.Value);
            else
                _triggerFetchNavigatorTask = new Zetbox.API.Async.ZbTask<Zetbox.App.Base.ObjectReferenceProperty>(Zetbox.API.Async.ZbTask.Synchron, () => null);

            _triggerFetchNavigatorTask.OnResult(t =>
            {
                if (OnNavigator_Getter != null)
                {
                    var e = new PropertyGetterEventArgs<Zetbox.App.Base.ObjectReferenceProperty>(t.Result);
                    OnNavigator_Getter(this, e);
                    t.Result = e.Result;
                }
            });

            return _triggerFetchNavigatorTask;
        }
Example #42
0
 public static void get_AufwandGes(Projekt obj, PropertyGetterEventArgs <double?> e)
 {
     e.Result = obj.Tasks.Sum(t => t.Aufwand);
 }