Esempio n. 1
0
        /// <exception cref="Exception">Root schema does not include a BIE schema.</exception>
        public ImporterContext(ICctsRepository cctsRepository, string rootSchemaPath)
        {
            RootSchemaPath     = rootSchemaPath;
            RootSchemaFileName = Path.GetFileName(rootSchemaPath);

            string inputDirectory = Path.GetDirectoryName(rootSchemaPath) + @"\";

            foreach (string schemaLocation in GetIncludedSchemaLocations(rootSchemaPath))
            {
                if (schemaLocation.StartsWith("BusinessInformationEntity"))
                {
                    BIESchemaPath = inputDirectory + schemaLocation;
                }
                else if (schemaLocation.StartsWith("BusinessDataType"))
                {
                    BDTSchemaPath = inputDirectory + schemaLocation;
                }
            }
            if (BDTSchemaPath == null)
            {
                throw new Exception("Root schema does not include a BDT schema.");
            }
            if (BIESchemaPath == null)
            {
                throw new Exception("Root schema does not include a BIE schema.");
            }

            CDTLibrary  = cctsRepository.GetCdtLibraries().ElementAt(0);
            CCLibrary   = cctsRepository.GetCcLibraries().ElementAt(0);
            BDTLibrary  = cctsRepository.GetBdtLibraries().ElementAt(0);
            BIELibrary  = cctsRepository.GetBieLibraries().ElementAt(0);
            PRIMLibrary = cctsRepository.GetPrimLibraries().ElementAt(0);
            BLibrary    = cctsRepository.GetBLibraries().ElementAt(0);
        }