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

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

private addToImportMappingFile ( XmlMapper mapper, string sourceXPath, string destinationXPath, decimal max, string name, string nameType ) : XmlMapper
mapper BExIS.Xml.Models.Mapping.XmlMapper
sourceXPath string
destinationXPath string
max decimal
name string
nameType string
Результат BExIS.Xml.Models.Mapping.XmlMapper
        private XmlMapper addToImportMappingFile(XmlMapper mapper, string sourceXPath, string destinationXPath, decimal max, string name, string nameType)
        {
            string parentExternalName = destinationXPath.Split('/').Last();
            string childSourceXPath = sourceXPath + "/" + name;
            string childDestinationXPath = destinationXPath + "/" + name+ "/" + nameType;

            XmlMappingRoute xmr = new XmlMappingRoute();

            xmr.Source = new Source(childSourceXPath);

            string sequence = parentExternalName;
            if (max > 1)
            {
                sequence = nameType;
            }

            xmr.Destination = new Destination(childDestinationXPath, sequence);

            mapper.Routes.Add(xmr);

            return mapper;
        }