BExIS.Xml.Helpers.Mapping.XmlSchemaManager.addToSchemaSet C# (CSharp) Метод

addToSchemaSet() приватный Метод

private addToSchemaSet ( XmlSchemaObject xmlSchemaObject, XmlSchemaSet xmlSchemaSet ) : XmlSchemaSet
xmlSchemaObject System.Xml.Schema.XmlSchemaObject
xmlSchemaSet System.Xml.Schema.XmlSchemaSet
Результат System.Xml.Schema.XmlSchemaSet
        private XmlSchemaSet addToSchemaSet(XmlSchemaObject xmlSchemaObject, XmlSchemaSet xmlSchemaSet )
        {
            if (xmlSchemaObject is XmlSchemaInclude)
            {
                XmlSchemaInclude include = (XmlSchemaInclude)xmlSchemaObject;

                if (include.Schema == null)
                {
                    XmlReaderSettings settings = new XmlReaderSettings();
                    settings.DtdProcessing = DtdProcessing.Ignore;

                    string dataPath = Path.Combine(AppConfiguration.DataPath, "Temp", userName, include.SchemaLocation.Split('/').Last());

                    XmlReader test = XmlReader.Create(dataPath, settings);
                    include.Schema = XmlSchema.Read(test, verifyErrors);
                }

                xmlSchemaSet.Add(include.Schema);
                additionalFiles.Add(Path.GetFileName(include.Schema.SourceUri.ToString()));
                // if schema has included schemas
                if (include.Schema.Includes.Count > 0)
                {
                    foreach (XmlSchemaObject additional in include.Schema.Includes)
                    {
                        addToSchemaSet(additional, xmlSchemaSet);
                    }
                }

                return xmlSchemaSet;
            }

            return xmlSchemaSet;
        }