Esempio n. 1
0
        public void GenerateNewTypes(string providerName, IReadOnlyCollection <DataTypeDescriptor> dataTypeDescriptors, bool makeAFlush)
        {
            Verify.ArgumentNotNullOrEmpty(providerName, "providerName");
            Verify.ArgumentNotNull(dataTypeDescriptors, "dataTypeDescriptors");

            foreach (var dataTypeDescriptor in dataTypeDescriptors)
            {
                UpdateWithNewMetaDataForeignKeySystem(dataTypeDescriptor);
                UpdateWithNewPageFolderForeignKeySystem(dataTypeDescriptor, false);
            }

            var types = DataTypeTypesManager.GetDataTypes(dataTypeDescriptors);

            foreach (var dataTypeDescriptor in dataTypeDescriptors)
            {
                dataTypeDescriptor.TypeManagerTypeName = TypeManager.SerializeType(types[dataTypeDescriptor.DataTypeId]);
            }

            DynamicTypeManager.CreateStores(providerName, dataTypeDescriptors, makeAFlush);

            if (makeAFlush && dataTypeDescriptors.Any(d => d.IsCodeGenerated))
            {
                CodeGenerationManager.GenerateCompositeGeneratedAssembly(true);
            }
        }
Esempio n. 2
0
        /// <exclude />
        public override IEnumerable <XElement> Install()
        {
            Verify.IsNotNull(_typesToInstall, "DataTypePackageFragmentInstaller has not been validated");

            string typeNames = string.Join(", ", _typesToInstall.Select(t => t.GetFullInterfaceName()));

            Log.LogVerbose(this.GetType().Name, "Installing types: '{0}'", typeNames);


            DynamicTypeManager.CreateStores(_typesToInstall, false);

            var typeElements = new List <XElement>();

            foreach (var dataTypeDescriptor in _typesToInstall)
            {
                var typeElement = new XElement("Type", new XAttribute("typeId", dataTypeDescriptor.DataTypeId));
                typeElements.Add(typeElement);
            }

            GlobalEventSystemFacade.FlushTheSystem(true);

            yield return(new XElement("Types", typeElements));
        }