public MIMSyncConfigDocumenter(string targetSystem, string referenceSystem)
        {
            Logger.Instance.WriteMethodEntry("TargetSystem: '{0}'. ReferenceSystem: '{1}'.", targetSystem, referenceSystem);

            try
            {
                this.pilotConfigRelativePath      = targetSystem;
                this.productionConfigRelativePath = referenceSystem;
                this.ReportFileName    = Documenter.GetTempFilePath("Report.tmp.html");
                this.ReportToCFileName = Documenter.GetTempFilePath("Report.TOC.tmp.html");

                var rootDirectory = Directory.GetCurrentDirectory().TrimEnd('\\');

                this.pilotConfigDirectory      = string.Format(CultureInfo.InvariantCulture, @"{0}\Data\{1}", rootDirectory, this.pilotConfigRelativePath);
                this.productionConfigDirectory = string.Format(CultureInfo.InvariantCulture, @"{0}\Data\{1}", rootDirectory, this.productionConfigRelativePath);
                this.configReportFilePath      = Documenter.ReportFolder + @"\" + Documenter.GetReportFileBaseName(this.pilotConfigRelativePath, this.productionConfigRelativePath) + "_Sync_report.html";

                this.ValidateInput();
                this.MergeSyncExports();
            }
            finally
            {
                Logger.Instance.WriteMethodExit("TargetSystem: '{0}'. ReferenceSystem: '{1}'.", targetSystem, referenceSystem);
            }
        }
Esempio n. 2
0
        private XElement MergeServiceConfigurationExports(bool?pilotConfig)
        {
            Logger.Instance.WriteMethodEntry("Pilot Config: '{0}'.", pilotConfig);

            try
            {
                var configDirectory = pilotConfig == null ? this.changesConfigDirectory : (bool)pilotConfig ? this.pilotConfigDirectory : this.productionConfigDirectory;
                var elementName     = pilotConfig == null ? "Changes" : (bool)pilotConfig ? "Pilot" : "Production";
                var templateXml     = string.Format(CultureInfo.InvariantCulture, "<Root><ServiceConfig><{0}/></ServiceConfig></Root>", elementName);
                var configXml       = XElement.Parse(templateXml);

                var config = configXml.XPathSelectElement("*//" + elementName);

                var searchPatern = pilotConfig == null?Documenter.GetReportFileBaseName(this.pilotConfigRelativePath, this.productionConfigRelativePath) + "_changes_??????.xml" : "*.xml";

                foreach (var file in Directory.EnumerateFiles(configDirectory + "/ServiceConfig", searchPatern))
                {
                    config.Add(XElement.Load(file));
                }

                return(configXml);
            }
            finally
            {
                Logger.Instance.WriteMethodEntry("Pilot Config: '{0}'.", pilotConfig);
            }
        }