private static void Call(Arebis.CodeGeneration.IGenerationHost host,
            IZetboxContext ctx,
            Serialization.SerializationMembersList serializationList,
            Property prop, bool hasPersistentOrder, bool isList,
            string collectionWrapperClass,
            string listWrapperClass)
        {
            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 backingCollectionType = (hasPersistentOrder ? listWrapperClass : collectionWrapperClass);

            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 providerCollectionType = "ObservableCollection<" + referencedCollectionEntryImpl + ">";
            string underlyingCollectionName = "_" + name + "Collection";

            string moduleNamespace = prop.Module.Namespace;

            Call(
                host, ctx, serializationList,
                name, backingName, backingCollectionType, exposedCollectionInterface,
                thisInterface, referencedType,
                referencedCollectionEntry, referencedCollectionEntryImpl,
                providerCollectionType, underlyingCollectionName, !hasPersistentOrder,
                moduleNamespace,
                prop.DisableExport == true);
        }
 public NotifyingDataProperty(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Serialization.SerializationMembersList serializationList, Property prop)
     : this(_host, ctx, serializationList, 
             prop.GetElementTypeString(), 
             prop.Name, prop.Module.Namespace, "_" + prop.Name, 
             prop.IsCalculated(), prop.DisableExport == true, 
             prop.ObjectClass.Name, prop.IsNullable(),
             prop.DefaultValue != null && !prop.IsCalculated(), // No default value for calculated properties, default values are used then for database migration
             prop.ExportGuid)
 {
 }
Exemple #3
0
        public static void Call(Arebis.CodeGeneration.IGenerationHost host,
            IZetboxContext ctx,
            Property prop,
            bool isReadOnly)
        {
            if (host == null) { throw new ArgumentNullException("host"); }
            if (prop == null) { throw new ArgumentNullException("prop"); }

            string eventName = "On" + prop.Name;
            string propType = prop.GetElementTypeString();
            string objType = prop.ObjectClass.GetDataTypeString();

            Call(host, ctx, eventName, propType, objType, true, !isReadOnly);
        }
        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);
        }
 public NotifyingDataProperty(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, Serialization.SerializationMembersList serializationList, Property prop)
     : base(_host, ctx, serializationList, prop.GetElementTypeString(), prop.Name, prop.Module.Namespace, "_" + prop.Name, prop.IsCalculated(), prop.DisableExport == true)
 {
     _prop = prop;
 }
Exemple #6
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);
 }