예제 #1
0
        internal void BuildAllCode(CodeGenerationBuilder codeGenerationBuilder)
        {
            var codeBuilder = new XmlDataProviderCodeBuilder(_dataProviderContext.ProviderName, codeGenerationBuilder);

            foreach (XmlProviderInterfaceConfigurationElement element in _dataTypeConfigurationElements)
            {
                if (element.DataTypeId == Guid.Empty)
                {
                    continue;
                }

                Guid dataTypeId = element.DataTypeId;

                DataTypeDescriptor dataTypeDescriptor = DataMetaDataFacade.GetDataTypeDescriptor(dataTypeId);

                if (dataTypeDescriptor == null)
                {
                    Log.LogError(LogTitle, "Failed to find interface by id '{0}'. Skipping code generation for that type", dataTypeId);
                    continue;
                }

                if (!dataTypeDescriptor.ValidateRuntimeType())
                {
                    Log.LogError(LogTitle, "The non code generated interface type '{0}' was not found, skipping code generation for that type", dataTypeDescriptor);
                    continue;
                }

                codeBuilder.AddDataType(dataTypeDescriptor);
            }
        }