/// <summary> /// The "real" main. This is where all the work in the program starts. /// </summary> ///<remarks> ///Due to technical reasons (see the remarks on "WriteContracts" and "GetContracts"), ///the contracts are gathered first then they are written out. This is instead of ///writting the contracts while they are being found. ///</remarks> ///<remarks> ///The contracts are gathered first then they are written out. We make one pass over the assembly ///to gather contracts, then one pass over the XML file to write out the contracts. This is instead ///of writing the contracts as they are being found, because all members in the assembly may not ///be represented in the XML file or may appear in a different order. ///</remarks> public static int RealMain(string[] args) { #region Parse options var options = new Options(); options.Parse(args); if (options.HelpRequested) { options.PrintOptions(""); return(1); } if (options.HasErrors) { options.PrintErrorsAndExit(Console.Out); return(-1); } if (options.breakIntoDebugger) { System.Diagnostics.Debugger.Break(); } if (options.assembly == null && options.GeneralArguments.Count > 0) { options.assembly = options.GeneralArguments[0]; } #endregion try { TrySendLeaderBoardPing(options); #region Set up the DocTracker. (Used for debug output.) TextWriter writer = null; //A null writer is allowed. if (options.debug) { if (options.outFile != null) { writer = new StreamWriter(options.outFile); } else { writer = Console.Out; } } DocTracker docTracker = new DocTracker(writer); #endregion #region Collect and write contracts var contracts = GetContracts(options, docTracker); WriteContracts(contracts, options, docTracker); #endregion #region Write contract statistics docTracker.WriteContractsPerKind(MemberKind.Type); docTracker.WriteContractsPerKind(MemberKind.Property); docTracker.WriteContractsPerKind(MemberKind.Method); #endregion } catch { SendLeaderBoardFailure(); throw; } return(0); //success }
/// <summary> /// The "real" main. This is where all the work in the program starts. /// </summary> ///<remarks> ///Due to technical reasons (see the remarks on "WriteContracts" and "GetContracts"), ///the contracts are gathered first then they are written out. This is instead of ///writting the contracts while they are being found. ///</remarks> ///<remarks> ///The contracts are gathered first then they are written out. We make one pass over the assembly ///to gather contracts, then one pass over the XML file to write out the contracts. This is instead ///of writing the contracts as they are being found, because all members in the assembly may not ///be represented in the XML file or may appear in a different order. ///</remarks> public static int RealMain(string[] args) { #region Parse options var options = new Options(); options.Parse(args); if (options.HelpRequested) { options.PrintOptions(""); return 1; } if (options.HasErrors) { options.PrintErrorsAndExit(Console.Out); return -1; } if (options.breakIntoDebugger) { System.Diagnostics.Debugger.Break(); } if (options.assembly == null && options.GeneralArguments.Count > 0) { options.assembly = options.GeneralArguments[0]; } #endregion try { TrySendLeaderBoardPing(options); #region Set up the DocTracker. (Used for debug output.) TextWriter writer = null; //A null writer is allowed. if (options.debug) { if (options.outFile != null) writer = new StreamWriter(options.outFile); else writer = Console.Out; } DocTracker docTracker = new DocTracker(writer); #endregion #region Collect and write contracts var contracts = GetContracts(options, docTracker); WriteContracts(contracts, options, docTracker); #endregion #region Write contract statistics docTracker.WriteContractsPerKind(MemberKind.Type); docTracker.WriteContractsPerKind(MemberKind.Property); docTracker.WriteContractsPerKind(MemberKind.Method); #endregion } catch { SendLeaderBoardFailure(); throw; } return 0; //success }