/// <summary>
        /// MIM Configuration Documenter Entry Point.
        /// </summary>
        /// <param name="args">The command-line arguments.</param>
        public static void Main(string[] args)
        {
            if (args == null || args.Length < 2)
            {
                string errorMsg = string.Format(CultureInfo.CurrentUICulture, "Usage: {0} {1} {2}.", new object[] { Assembly.GetExecutingAssembly().GetName().Name, "{Pilot / Target Config Folder}", "{Production / Reference / Baseline Config Folder}" });
                throw new ArgumentException(errorMsg, "args");
            }

            if (args.Length == 3)
            {
                switch (args[2])
                {
                case "SyncOnly":
                    var syncDocumenter = new MIMSyncConfigDocumenter(args[0], args[1]);
                    syncDocumenter.GenerateReport();
                    return;

                case "ServiceOnly":
                    var serviceDocumenter = new MIMServiceConfigDocumenter(args[0], args[1]);
                    serviceDocumenter.GenerateReport();
                    return;
                }
            }

            var documenter = new MIMConfigDocumenter(args[0], args[1]);

            documenter.GenerateReport();
        }
Beispiel #2
0
        public override Tuple <string, string> GetReport()
        {
            Logger.Instance.WriteMethodEntry();

            Tuple <string, string> report;

            try
            {
                Tuple <string, string> syncReportTuple        = new Tuple <string, string>(string.Empty, string.Empty);
                Tuple <string, string> serviceDocumenterTuple = new Tuple <string, string>(string.Empty, string.Empty);

                try
                {
                    var syncDocumenter = new MIMSyncConfigDocumenter(this.pilotConfigRelativePath, this.productionConfigRelativePath);
                    syncReportTuple = syncDocumenter.GetReport();
                }
                catch (FileNotFoundException e)
                {
                    Logger.Instance.WriteError(e.ToString());
                }

                try
                {
                    var serviceDocumenter = new MIMServiceConfigDocumenter(this.pilotConfigRelativePath, this.productionConfigRelativePath);
                    serviceDocumenterTuple = serviceDocumenter.GetReport();
                }
                catch (FileNotFoundException e)
                {
                    Logger.Instance.WriteError(e.ToString());
                }

                report = new Tuple <string, string>(syncReportTuple.Item1 + serviceDocumenterTuple.Item1, syncReportTuple.Item2 + serviceDocumenterTuple.Item2);
            }
            catch (Exception e)
            {
                throw Logger.Instance.ReportError(e);
            }
            finally
            {
                Logger.Instance.WriteMethodExit();
            }

            return(report);
        }