コード例 #1
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 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;

        }
コード例 #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;
 }
コード例 #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;
 }
コード例 #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);
     }
 }
コード例 #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);
        }
コード例 #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);
     }
 }
コード例 #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;
 }
コード例 #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);
     }
 }
コード例 #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);
     }
 }
コード例 #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;
 }
コード例 #11
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;

        }
コード例 #12
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;

        }
コード例 #13
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;

        }
コード例 #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);
     }
 }
コード例 #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;
 }
コード例 #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);
     }
 }
コード例 #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);
     }
 }
コード例 #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);
 }
コード例 #19
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;

        }
コード例 #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);
            }
        }
コード例 #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;
 }
コード例 #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);
            }
        }
コード例 #23
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;

        }
コード例 #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;
 }
コード例 #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);
        }
コード例 #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);
 }
コード例 #27
0
        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;

        }
コード例 #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);
        }
コード例 #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);
         }
     }
 }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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;
 }
コード例 #33
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;

        }
コード例 #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;
 }
コード例 #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;
 }
コード例 #36
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;

        }
コード例 #37
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;

        }
コード例 #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);
        }
コード例 #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);
         }
     }
 }
コード例 #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);
        }