public ObjectReferencePropertyTemplate(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Zetbox.Generator.Templates.Serialization.SerializationMembersList serializationList, string moduleNamespace, string ownInterface, string name, string implNameUnused, string eventName, string fkBackingName, string fkGuidBackingName, string referencedInterface, string referencedImplementation, string associationNameUnused, string targetRoleNameUnused, string positionPropertyName, string inverseNavigatorName, bool inverseNavigatorIsList, bool notifyInverseCollection, bool eagerLoading, bool relDataTypeExportable, bool callGetterSetterEvents, bool isCalculated, bool disableExport)
            : base(_host)
        {
			this.ctx = ctx;
			this.serializationList = serializationList;
			this.moduleNamespace = moduleNamespace;
			this.ownInterface = ownInterface;
			this.name = name;
			this.implNameUnused = implNameUnused;
			this.eventName = eventName;
			this.fkBackingName = fkBackingName;
			this.fkGuidBackingName = fkGuidBackingName;
			this.referencedInterface = referencedInterface;
			this.referencedImplementation = referencedImplementation;
			this.associationNameUnused = associationNameUnused;
			this.targetRoleNameUnused = targetRoleNameUnused;
			this.positionPropertyName = positionPropertyName;
			this.inverseNavigatorName = inverseNavigatorName;
			this.inverseNavigatorIsList = inverseNavigatorIsList;
			this.notifyInverseCollection = notifyInverseCollection;
			this.eagerLoading = eagerLoading;
			this.relDataTypeExportable = relDataTypeExportable;
			this.callGetterSetterEvents = callGetterSetterEvents;
			this.isCalculated = isCalculated;
			this.disableExport = disableExport;

        }
Example #2
0
 public ValueCollectionProperty(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Zetbox.Generator.Templates.Serialization.SerializationMembersList serializationList, Property prop)
     : base(_host)
 {
     this.ctx = ctx;
     this.serializationList = serializationList;
     this.prop = prop;
 }
Example #3
0
 public ObjectReferencePropertyTemplate(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Zetbox.Generator.Templates.Serialization.SerializationMembersList serializationList, string moduleNamespace, string ownInterface, string name, string implNameUnused, string eventName, string fkBackingName, string fkGuidBackingName, string referencedInterface, string referencedImplementation, string associationNameUnused, string targetRoleNameUnused, string positionPropertyName, string inverseNavigatorName, bool inverseNavigatorIsList, bool eagerLoading, bool relDataTypeExportable, bool callGetterSetterEvents, bool isCalculated, bool disableExport)
     : base(_host)
 {
     this.ctx = ctx;
     this.serializationList = serializationList;
     this.moduleNamespace   = moduleNamespace;
     this.ownInterface      = ownInterface;
     this.name                     = name;
     this.implNameUnused           = implNameUnused;
     this.eventName                = eventName;
     this.fkBackingName            = fkBackingName;
     this.fkGuidBackingName        = fkGuidBackingName;
     this.referencedInterface      = referencedInterface;
     this.referencedImplementation = referencedImplementation;
     this.associationNameUnused    = associationNameUnused;
     this.targetRoleNameUnused     = targetRoleNameUnused;
     this.positionPropertyName     = positionPropertyName;
     this.inverseNavigatorName     = inverseNavigatorName;
     this.inverseNavigatorIsList   = inverseNavigatorIsList;
     this.eagerLoading             = eagerLoading;
     this.relDataTypeExportable    = relDataTypeExportable;
     this.callGetterSetterEvents   = callGetterSetterEvents;
     this.isCalculated             = isCalculated;
     this.disableExport            = disableExport;
 }
Example #4
0
 protected virtual void AddSerialization(Templates.Serialization.SerializationMembersList list, string memberName, bool eagerLoading)
 {
     if (list != null && eagerLoading)
     {
         list.Add("Serialization.EagerLoadingSerialization", Templates.Serialization.SerializerType.Binary, null, null, memberName, false, serializeRelationEntries, "this.Proxy." + memberName);
     }
 }
Example #5
0
        public static void Call(Arebis.CodeGeneration.IGenerationHost host,
                                IZetboxContext ctx,
                                Templates.Serialization.SerializationMembersList serializationList,
                                ObjectReferenceProperty prop, bool callGetterSetterEvents,
                                bool updateInverseNavigator)
        {
            if (ctx == null)
            {
                throw new ArgumentNullException("ctx");
            }
            if (prop == null)
            {
                throw new ArgumentNullException("prop");
            }

            string name                = prop.Name;
            string ownInterface        = prop.ObjectClass.GetDataTypeString();
            string referencedInterface = String.Format(
                "{0}.{1}",
                prop.GetReferencedObjectClass().Module.Namespace,
                prop.GetReferencedObjectClass().Name);

            var rel     = RelationExtensions.Lookup(ctx, prop);
            var endRole = rel.GetEnd(prop).GetRole();

            Call(host, ctx, serializationList,
                 ownInterface, name, referencedInterface, rel, endRole, callGetterSetterEvents, updateInverseNavigator, String.Empty);
        }
Example #6
0
 protected virtual void AddSerialization(Templates.Serialization.SerializationMembersList list, string memberName, bool eagerLoading)
 {
     if (list != null && eagerLoading)
     {
         list.Add("Serialization.EagerLoadingSerialization", Templates.Serialization.SerializerType.Binary, null, null, memberName, true, false, null);
     }
 }
Example #7
0
 public CollectionEntryListProperty(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Zetbox.Generator.Templates.Serialization.SerializationMembersList serializationList, Relation rel, RelationEndRole endRole)
     : base(_host)
 {
     this.ctx = ctx;
     this.serializationList = serializationList;
     this.rel     = rel;
     this.endRole = endRole;
 }
Example #8
0
 protected virtual void AddSerialization(Templates.Serialization.SerializationMembersList list, string memberName, bool eagerLoading)
 {
     if (list != null && eagerLoading)
     {
         string efName = memberName + ImplementationPropertySuffix;
         list.Add("Serialization.EagerLoadingSerialization", Templates.Serialization.SerializerType.Binary, null, null, memberName, false, rel.GetRelationType() == RelationType.n_m, efName);
     }
 }
Example #9
0
 protected virtual void AddSerialization(Templates.Serialization.SerializationMembersList list, string underlyingCollectionName)
 {
     // TODO: XML Namespace
     if (list != null)
     {
         Templates.Serialization.CollectionSerialization.Add(list, ctx, moduleNamespace, name, underlyingCollectionName, orderByValue, disableExport);
     }
 }
Example #10
0
 public EnumerationPropertyTemplate(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Zetbox.Generator.Templates.Serialization.SerializationMembersList serializationList, EnumerationProperty prop, bool callGetterSetterEvents)
     : base(_host)
 {
     this.ctx = ctx;
     this.serializationList = serializationList;
     this.prop = prop;
     this.callGetterSetterEvents = callGetterSetterEvents;
 }
        public ValueCollectionProperty(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Zetbox.Generator.Templates.Serialization.SerializationMembersList serializationList, Property prop)
            : base(_host)
        {
			this.ctx = ctx;
			this.serializationList = serializationList;
			this.prop = prop;

        }
        public CollectionEntryListProperty(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Zetbox.Generator.Templates.Serialization.SerializationMembersList serializationList, Relation rel, RelationEndRole endRole)
            : base(_host)
        {
			this.ctx = ctx;
			this.serializationList = serializationList;
			this.rel = rel;
			this.endRole = endRole;

        }
        public EnumerationPropertyTemplate(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Zetbox.Generator.Templates.Serialization.SerializationMembersList serializationList, EnumerationProperty prop, bool callGetterSetterEvents)
            : base(_host)
        {
			this.ctx = ctx;
			this.serializationList = serializationList;
			this.prop = prop;
			this.callGetterSetterEvents = callGetterSetterEvents;

        }
Example #14
0
 protected virtual void AddSerialization(Templates.Serialization.SerializationMembersList list, string efName)
 {
     if (list != null)
     {
         bool hasPersistentOrder = prop is ValueTypeProperty
             ? ((ValueTypeProperty)prop).HasPersistentOrder
             : ((CompoundObjectProperty)prop).HasPersistentOrder;
         Serialization.CollectionSerialization.Add(list, ctx, this.prop.Module.Namespace, this.prop.Name, efName, !hasPersistentOrder, prop.DisableExport == true);
     }
 }
Example #15
0
 public ValueCollectionEntryParentReference(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Zetbox.Generator.Templates.Serialization.SerializationMembersList serializationList, string referencedInterface, string propertyName, string moduleNamespace, bool disableExport)
     : base(_host)
 {
     this.ctx = ctx;
     this.serializationList   = serializationList;
     this.referencedInterface = referencedInterface;
     this.propertyName        = propertyName;
     this.moduleNamespace     = moduleNamespace;
     this.disableExport       = disableExport;
 }
Example #16
0
 protected override void AddSerialization(Templates.Serialization.SerializationMembersList list, string name)
 {
     if (list != null)
     {
         Templates.Serialization.SimplePropertySerialization
         .AddToSerializers(list,
                           disableExport ?  Templates.Serialization.SerializerType.Binary : Templates.Serialization.SerializerType.All,
                           modulenamespace, name, type, backingName);
     }
 }
Example #17
0
 protected virtual void AddSerialization(Templates.Serialization.SerializationMembersList list)
 {
     if (list != null)
     {
         var backingStoreName = String.Format("(({0})this).{1}",
                                              prop.ObjectClass.Module.Namespace + "." + prop.ObjectClass.Name,
                                              prop.Name);
         Templates.Serialization.EnumBinarySerialization.AddToSerializers(list, prop, backingStoreName);
     }
 }
Example #18
0
 public static void Call(Arebis.CodeGeneration.IGenerationHost host,
                         IZetboxContext ctx,
                         Templates.Serialization.SerializationMembersList serializationList,
                         ValueTypeProperty prop)
 {
     if (prop == null)
     {
         throw new ArgumentNullException("prop");
     }
     Call(host, ctx, serializationList, prop, prop.HasPersistentOrder, prop.IsList, !prop.HasPersistentOrder);
 }
        public ValueCollectionEntryParentReference(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Zetbox.Generator.Templates.Serialization.SerializationMembersList serializationList, string referencedInterface, string propertyName, string moduleNamespace, bool disableExport)
            : base(_host)
        {
			this.ctx = ctx;
			this.serializationList = serializationList;
			this.referencedInterface = referencedInterface;
			this.propertyName = propertyName;
			this.moduleNamespace = moduleNamespace;
			this.disableExport = disableExport;

        }
Example #20
0
        protected virtual void AddSerialization(
            Templates.Serialization.SerializationMembersList list,
            string memberType, string memberName,
            string backingStoreType, string backingStoreName)
        {
            if (list != null)
            {
                var xmlname = memberName;

                list.Add("Serialization.CompoundObjectSerialization", disableExport ? Templates.Serialization.SerializerType.Binary : Templates.Serialization.SerializerType.All,
                         this.xmlNamespace, xmlname, memberType, memberName, backingStoreType, backingStoreName);
            }
        }
Example #21
0
 public CompoundObjectPropertyTemplate(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Zetbox.Generator.Templates.Serialization.SerializationMembersList serializationList, string xmlNamespace, string propName, string backingPropertyName, string backingStoreName, string coType, string coImplementationType, bool disableExport)
     : base(_host)
 {
     this.ctx = ctx;
     this.serializationList   = serializationList;
     this.xmlNamespace        = xmlNamespace;
     this.propName            = propName;
     this.backingPropertyName = backingPropertyName;
     this.backingStoreName    = backingStoreName;
     this.coType = coType;
     this.coImplementationType = coImplementationType;
     this.disableExport        = disableExport;
 }
Example #22
0
        protected virtual void AddSerialization(Templates.Serialization.SerializationMembersList list, string sourceMember, string targetMember, string targetGuidMember)
        {
            if (list != null)
            {
                var proxyName = "this.Proxy." + name;

                if (relDataTypeExportable && !disableExport)
                {
                    list.Add("Serialization.ObjectReferencePropertySerialization", Templates.Serialization.SerializerType.ImportExport, moduleNamespace, name, proxyName, targetMember, targetGuidMember);
                }
                list.Add("Serialization.ObjectReferencePropertySerialization",
                         Templates.Serialization.SerializerType.Service, moduleNamespace, name, proxyName, targetMember, targetGuidMember);
            }
        }
        public CompoundObjectPropertyTemplate(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Zetbox.Generator.Templates.Serialization.SerializationMembersList serializationList, string xmlNamespace, string propName, string backingPropertyName, string backingStoreName, string coType, string coImplementationType, bool disableExport)
            : base(_host)
        {
			this.ctx = ctx;
			this.serializationList = serializationList;
			this.xmlNamespace = xmlNamespace;
			this.propName = propName;
			this.backingPropertyName = backingPropertyName;
			this.backingStoreName = backingStoreName;
			this.coType = coType;
			this.coImplementationType = coImplementationType;
			this.disableExport = disableExport;

        }
Example #24
0
 public ObjectListProperty(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Zetbox.Generator.Templates.Serialization.SerializationMembersList serializationList, string name, string wrapperName, string wrapperClass, string exposedListType, Relation rel, RelationEndRole endRole, string positionPropertyName, string otherName, string referencedInterface)
     : base(_host)
 {
     this.ctx = ctx;
     this.serializationList = serializationList;
     this.name                 = name;
     this.wrapperName          = wrapperName;
     this.wrapperClass         = wrapperClass;
     this.exposedListType      = exposedListType;
     this.rel                  = rel;
     this.endRole              = endRole;
     this.positionPropertyName = positionPropertyName;
     this.otherName            = otherName;
     this.referencedInterface  = referencedInterface;
 }
Example #25
0
        public static void Call(Arebis.CodeGeneration.IGenerationHost host,
                                IZetboxContext ctx,
                                Templates.Serialization.SerializationMembersList serializationList,
                                CompoundObjectProperty prop)
        {
            if (prop == null)
            {
                throw new ArgumentNullException("prop");
            }

            // CompoundObjects cannot be compared, therefore we have to avoid sorting the list here
            // although it would be required to keep the exported collection stable
            // TODO: implement a comparer for COs using a DefaultSortOrder property(-list) to re-enable this
            Call(host, ctx, serializationList, prop, prop.HasPersistentOrder, prop.IsList, false);
        }
Example #26
0
 protected override void ApplyNotifyingValueProperty(
     Property prop,
     Templates.Serialization.SerializationMembersList serList)
 {
     Properties.ProxyProperty.Call(Host, ctx,
                                   serList, prop.Module.Namespace, prop.GetElementTypeString(), prop.Name, false, true,
                                   prop.DefaultValue != null, prop.ObjectClass.GetDataTypeString(),
                                   prop.GetClassName(),
                                   prop.IsNullable(),
                                   "_is" + prop.Name + "Set",
                                   prop.ExportGuid,
                                   prop.GetElementTypeString(),
                                   "Proxy." + prop.Name,
                                   prop.IsCalculated(),
                                   prop.DisableExport == true);
 }
        public ObjectListProperty(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Zetbox.Generator.Templates.Serialization.SerializationMembersList serializationList, string name, bool eagerLoading, string wrapperName, string wrapperClass, string exposedListType, string positionPropertyName, string otherName, string referencedInterface, string referencedProxy)
            : base(_host)
        {
			this.ctx = ctx;
			this.serializationList = serializationList;
			this.name = name;
			this.eagerLoading = eagerLoading;
			this.wrapperName = wrapperName;
			this.wrapperClass = wrapperClass;
			this.exposedListType = exposedListType;
			this.positionPropertyName = positionPropertyName;
			this.otherName = otherName;
			this.referencedInterface = referencedInterface;
			this.referencedProxy = referencedProxy;

        }
Example #28
0
        public static void Call(Arebis.CodeGeneration.IGenerationHost host,
                                IZetboxContext ctx,
                                Templates.Serialization.SerializationMembersList serializationList,
                                Relation rel, RelationEndRole endRole)
        {
            if (rel == null)
            {
                throw new ArgumentNullException("rel");
            }

            RelationEnd relEnd   = rel.GetEndFromRole(endRole);
            RelationEnd otherEnd = rel.GetOtherEnd(relEnd);

            string backingCollectionType = RelationToBackingCollectionType(rel, otherEnd);

            Call(host, ctx, serializationList, rel, endRole, backingCollectionType);
        }
Example #29
0
 protected virtual void AddSerialization(Templates.Serialization.SerializationMembersList list, string sourceMember, string targetMember, string targetGuidMember, string clsFullName, string assocName, string targetRoleName)
 {
     if (list != null)
     {
         if (relDataTypeExportable && !disableExport)
         {
             list.Add("Serialization.ObjectReferencePropertySerialization",
                      Templates.Serialization.SerializerType.ImportExport, moduleNamespace, name, sourceMember, targetMember, targetGuidMember, clsFullName, assocName, targetRoleName);
         }
         list.Add("Serialization.ObjectReferencePropertySerialization",
                  Templates.Serialization.SerializerType.Service, moduleNamespace, name, sourceMember, targetMember, targetGuidMember, clsFullName, assocName, targetRoleName);
         if (eagerLoading)
         {
             list.Add("Serialization.EagerObjectLoadingSerialization",
                      Templates.Serialization.SerializerType.Binary, moduleNamespace, name, sourceMember);
         }
     }
 }
Example #30
0
        private static void Call(Arebis.CodeGeneration.IGenerationHost host,
                                 IZetboxContext ctx,
                                 Templates.Serialization.SerializationMembersList serializationList,
                                 Property prop, bool hasPersistentOrder, bool isList, bool orderByValue)
        {
            if (prop == null)
            {
                throw new ArgumentNullException("prop");
            }
            if (!isList)
            {
                throw new ArgumentOutOfRangeException("prop", "prop must be a List-valued property");
            }

            string name        = prop.Name;
            string backingName = "_" + name;
            string exposedCollectionInterface = hasPersistentOrder ? "IList" : "ICollection";

            string thisInterface                  = prop.ObjectClass.Name;
            string referencedType                 = prop.GetElementTypeString();
            string referencedCollectionEntry      = prop.GetCollectionEntryFullName();
            string referencedCollectionEntryImpl  = referencedCollectionEntry + host.Settings["extrasuffix"] + Zetbox.API.Helper.ImplementationSuffix;
            string referencedCollectionEntryProxy = referencedCollectionEntryImpl + "." + prop.GetCollectionEntryClassName() + "Proxy";

            string providerCollectionType          = "ICollection<" + referencedCollectionEntryImpl + ">";
            string underlyingCollectionName        = name + "Collection";
            string underlyingCollectionBackingName = backingName + "Collection";
            string moduleNamespace = prop.Module.Namespace;

            string backingCollectionType = (hasPersistentOrder ? "ClientValueListWrapper" : "ClientValueCollectionWrapper")
                                           + String.Format("<{0}, {1}, {2}, {3}, {4}>",
                                                           thisInterface,
                                                           referencedType,
                                                           referencedCollectionEntry,
                                                           referencedCollectionEntryImpl,
                                                           providerCollectionType);

            Call(
                host, ctx, serializationList,
                name, backingName, backingCollectionType, exposedCollectionInterface,
                thisInterface, referencedType, referencedCollectionEntry, referencedCollectionEntryImpl, referencedCollectionEntryProxy,
                providerCollectionType, underlyingCollectionName, underlyingCollectionBackingName,
                orderByValue, moduleNamespace, prop.DisableExport == true);
        }
Example #31
0
        public static void Call(Arebis.CodeGeneration.IGenerationHost host,
                                IZetboxContext ctx,
                                Templates.Serialization.SerializationMembersList serializationList,
                                ObjectReferenceProperty prop)
        {
            if (host == null)
            {
                throw new ArgumentNullException("host");
            }
            if (ctx == null)
            {
                throw new ArgumentNullException("ctx");
            }
            if (prop == null)
            {
                throw new ArgumentNullException("prop");
            }
            if (!prop.IsList())
            {
                throw new ArgumentOutOfRangeException("prop", "prop must be a List-valued property");
            }

            var rel      = RelationExtensions.Lookup(ctx, prop);
            var relEnd   = rel.GetEnd(prop);
            var otherEnd = rel.GetOtherEnd(relEnd);

            string name = prop.Name;

            // whether or not the collection will be eagerly loaded
            bool eagerLoading = relEnd.Navigator != null && relEnd.Navigator.EagerLoading;

            string wrapperName  = "_" + name;
            string wrapperClass = "OneNRelationList";

            var exposedListType = otherEnd.HasPersistentOrder ? "IList" : "ICollection";
            // the name of the position property
            var positionPropertyName = rel.NeedsPositionStorage(otherEnd.GetRole()) ? Construct.ListPositionPropertyName(otherEnd) : String.Empty;
            var otherName            = otherEnd.Navigator == null ? relEnd.RoleName : otherEnd.Navigator.Name;
            var referencedInterface  = otherEnd.Type.GetDataTypeString();
            var referencedProxy      = Mappings.ObjectClassHbm.GetProxyTypeReference(otherEnd.Type, host.Settings);

            Call(host, ctx, serializationList, name, eagerLoading, wrapperName, wrapperClass, exposedListType, positionPropertyName, otherName, referencedInterface, referencedProxy);
        }
Example #32
0
 public ValueCollectionProperty(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Zetbox.Generator.Templates.Serialization.SerializationMembersList serializationList, string name, string backingName, string backingCollectionType, string exposedCollectionInterface, string thisInterface, string referencedType, string entryType, string entryTypeImpl, string providerCollectionType, string underlyingCollectionName, bool orderByValue, string moduleNamespace, bool disableExport)
     : base(_host)
 {
     this.ctx = ctx;
     this.serializationList = serializationList;
     this.name                       = name;
     this.backingName                = backingName;
     this.backingCollectionType      = backingCollectionType;
     this.exposedCollectionInterface = exposedCollectionInterface;
     this.thisInterface              = thisInterface;
     this.referencedType             = referencedType;
     this.entryType                  = entryType;
     this.entryTypeImpl              = entryTypeImpl;
     this.providerCollectionType     = providerCollectionType;
     this.underlyingCollectionName   = underlyingCollectionName;
     this.orderByValue               = orderByValue;
     this.moduleNamespace            = moduleNamespace;
     this.disableExport              = disableExport;
 }
        public ValueCollectionProperty(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Zetbox.Generator.Templates.Serialization.SerializationMembersList serializationList, string name, string backingName, string backingCollectionType, string exposedCollectionInterface, string thisInterface, string referencedType, string entryType, string entryTypeImpl, string providerCollectionType, string underlyingCollectionName, bool orderByValue, string moduleNamespace, bool disableExport)
            : base(_host)
        {
			this.ctx = ctx;
			this.serializationList = serializationList;
			this.name = name;
			this.backingName = backingName;
			this.backingCollectionType = backingCollectionType;
			this.exposedCollectionInterface = exposedCollectionInterface;
			this.thisInterface = thisInterface;
			this.referencedType = referencedType;
			this.entryType = entryType;
			this.entryTypeImpl = entryTypeImpl;
			this.providerCollectionType = providerCollectionType;
			this.underlyingCollectionName = underlyingCollectionName;
			this.orderByValue = orderByValue;
			this.moduleNamespace = moduleNamespace;
			this.disableExport = disableExport;

        }
Example #34
0
 public ProxyProperty(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Zetbox.Generator.Templates.Serialization.SerializationMembersList serializationList, string moduleNamespace, string propertyType, string propertyName, bool overrideParent, bool useEvents, bool hasDefaultValue, string interfaceName, string className, bool isNullable, string isSetFlagName, Guid propertyGuid, string backingStoreType, string backingStoreName, bool isCalculated, bool disableExport)
     : base(_host)
 {
     this.ctx = ctx;
     this.serializationList = serializationList;
     this.moduleNamespace   = moduleNamespace;
     this.propertyType      = propertyType;
     this.propertyName      = propertyName;
     this.overrideParent    = overrideParent;
     this.useEvents         = useEvents;
     this.hasDefaultValue   = hasDefaultValue;
     this.interfaceName     = interfaceName;
     this.className         = className;
     this.isNullable        = isNullable;
     this.isSetFlagName     = isSetFlagName;
     this.propertyGuid      = propertyGuid;
     this.backingStoreType  = backingStoreType;
     this.backingStoreName  = backingStoreName;
     this.isCalculated      = isCalculated;
     this.disableExport     = disableExport;
 }
Example #35
0
 public CollectionEntryListProperty(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Zetbox.Generator.Templates.Serialization.SerializationMembersList serializationList, string name, string exposedCollectionInterface, string referencedInterface, string backingName, string backingCollectionType, string aSideType, string bSideType, string entryType, string providerCollectionType, Guid relId, RelationEndRole role, bool eagerLoading, bool serializeRelationEntries, string entryProxyType, string inverseNavigatorName)
     : base(_host)
 {
     this.ctx = ctx;
     this.serializationList = serializationList;
     this.name = name;
     this.exposedCollectionInterface = exposedCollectionInterface;
     this.referencedInterface        = referencedInterface;
     this.backingName            = backingName;
     this.backingCollectionType  = backingCollectionType;
     this.aSideType              = aSideType;
     this.bSideType              = bSideType;
     this.entryType              = entryType;
     this.providerCollectionType = providerCollectionType;
     this.relId                    = relId;
     this.role                     = role;
     this.eagerLoading             = eagerLoading;
     this.serializeRelationEntries = serializeRelationEntries;
     this.entryProxyType           = entryProxyType;
     this.inverseNavigatorName     = inverseNavigatorName;
 }
        public CollectionEntryListProperty(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Zetbox.Generator.Templates.Serialization.SerializationMembersList serializationList, string name, string exposedCollectionInterface, string referencedInterface, string backingName, string backingCollectionType, string aSideType, string bSideType, string entryType, string providerCollectionType, Guid relId, RelationEndRole role, bool eagerLoading, bool serializeRelationEntries, string entryProxyType, string inverseNavigatorName)
            : base(_host)
        {
			this.ctx = ctx;
			this.serializationList = serializationList;
			this.name = name;
			this.exposedCollectionInterface = exposedCollectionInterface;
			this.referencedInterface = referencedInterface;
			this.backingName = backingName;
			this.backingCollectionType = backingCollectionType;
			this.aSideType = aSideType;
			this.bSideType = bSideType;
			this.entryType = entryType;
			this.providerCollectionType = providerCollectionType;
			this.relId = relId;
			this.role = role;
			this.eagerLoading = eagerLoading;
			this.serializeRelationEntries = serializeRelationEntries;
			this.entryProxyType = entryProxyType;
			this.inverseNavigatorName = inverseNavigatorName;

        }
        public ProxyProperty(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Zetbox.Generator.Templates.Serialization.SerializationMembersList serializationList, string moduleNamespace, string propertyType, string propertyName, bool overrideParent, bool useEvents, bool hasDefaultValue, string interfaceName, string className, bool isNullable, string isSetFlagName, Guid propertyGuid, string backingStoreType, string backingStoreName, bool isCalculated, bool disableExport)
            : base(_host)
        {
			this.ctx = ctx;
			this.serializationList = serializationList;
			this.moduleNamespace = moduleNamespace;
			this.propertyType = propertyType;
			this.propertyName = propertyName;
			this.overrideParent = overrideParent;
			this.useEvents = useEvents;
			this.hasDefaultValue = hasDefaultValue;
			this.interfaceName = interfaceName;
			this.className = className;
			this.isNullable = isNullable;
			this.isSetFlagName = isSetFlagName;
			this.propertyGuid = propertyGuid;
			this.backingStoreType = backingStoreType;
			this.backingStoreName = backingStoreName;
			this.isCalculated = isCalculated;
			this.disableExport = disableExport;

        }
Example #38
0
        public static void Call(Arebis.CodeGeneration.IGenerationHost host,
                                IZetboxContext ctx,
                                Templates.Serialization.SerializationMembersList serializationList,
                                Relation rel, RelationEndRole endRole, string backingCollectionType)
        {
            if (host == null)
            {
                throw new ArgumentNullException("host");
            }
            if (rel == null)
            {
                throw new ArgumentNullException("rel");
            }


            RelationEnd relEnd   = rel.GetEndFromRole(endRole);
            RelationEnd otherEnd = rel.GetOtherEnd(relEnd);

            string name = relEnd.Navigator.Name;
            string exposedCollectionInterface = rel.NeedsPositionStorage(otherEnd.GetRole()) ? "IList" : "ICollection";
            string referencedInterface        = otherEnd.Type.GetDataTypeString();
            string backingName = "_" + name;

            string aSideType = rel.A.Type.GetDataTypeString();
            string bSideType = rel.B.Type.GetDataTypeString();
            string entryType = rel.GetRelationFullName() + host.Settings["extrasuffix"] + Zetbox.API.Helper.ImplementationSuffix;
            string providerCollectionType = (rel.NeedsPositionStorage(otherEnd.GetRole()) ? "IList<" : "ICollection<")
                                            + entryType + ">";

            bool eagerLoading             = relEnd.Navigator != null && relEnd.Navigator.EagerLoading;
            bool serializeRelationEntries = rel.GetRelationType() == RelationType.n_m;

            string entryProxyType = entryType + "." + rel.GetRelationClassName() + "Proxy";

            string inverseNavigatorName = otherEnd.Navigator != null ? otherEnd.Navigator.Name : null;

            Call(host, ctx, serializationList, name, exposedCollectionInterface, referencedInterface, backingName, backingCollectionType, aSideType, bSideType, entryType, providerCollectionType, rel.ExportGuid, endRole, eagerLoading, serializeRelationEntries, entryProxyType, inverseNavigatorName);
        }
Example #39
0
 protected virtual void AddSerialization(
     Templates.Serialization.SerializationMembersList list,
     string memberName,
     string fkBackingName)
 {
     if (list != null)
     {
         if (hasDefaultValue)
         {
             Templates.Serialization.SimplePropertyWithDefaultSerialization
             .AddToSerializers(list,
                               disableExport ? Templates.Serialization.SerializerType.Binary : Templates.Serialization.SerializerType.All,
                               moduleNamespace, propertyName, propertyType, "Proxy." + propertyName, isSetFlagName);
         }
         else
         {
             Templates.Serialization.SimplePropertySerialization
             .AddToSerializers(list,
                               disableExport ? Templates.Serialization.SerializerType.Binary : Templates.Serialization.SerializerType.All,
                               moduleNamespace, propertyName, propertyType, "Proxy." + propertyName);
         }
     }
 }
Example #40
0
        public static void Call(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Zetbox.Generator.Templates.Serialization.SerializationMembersList serializationList, string moduleNamespace, string propertyType, string propertyName, bool overrideParent, bool useEvents, bool hasDefaultValue, string interfaceName, string className, bool isNullable, string isSetFlagName, Guid propertyGuid, string backingStoreType, string backingStoreName, bool isCalculated, bool disableExport)
        {
            if (_host == null)
            {
                throw new global::System.ArgumentNullException("_host");
            }

            _host.CallTemplate("Properties.ProxyProperty", ctx, serializationList, moduleNamespace, propertyType, propertyName, overrideParent, useEvents, hasDefaultValue, interfaceName, className, isNullable, isSetFlagName, propertyGuid, backingStoreType, backingStoreName, isCalculated, disableExport);
        }