Exemple #1
0
        private DataSchema InitializeSchema()
        {
            var verificationContext = new VerificationContext();
            DataSchema dataSchema = new DataSchema();
            dataSchema.Name = Path.GetFileNameWithoutExtension(DataTypesFilePath);
            using (StreamReader reader = new StreamReader(DataTypesFilePath))
            {
                dataSchema.LoadDataSchemaFile(reader, verificationContext);
            }
            dataSchema.Verify(verificationContext);

            if (!backgroundWorker.CancellationPending && verificationContext.HasErrors)
            {
                ReportErrors(verificationContext);
                return null;
            }

            return dataSchema;
        }