/// <summary> /// Initializes a new instance. /// </summary> private Program(TeamFoundationServerGateway tfsGateway, IMailGateway mailGateway, TimeSpan cutoffTimeSpan) { m_tfsGateway = tfsGateway; m_adGateway = new ActiveDirectoryGateway(); m_mailGateway = mailGateway; m_runTime = DateTime.Now; m_cutoffTimeSpan = cutoffTimeSpan; }
/// <summary> /// Assembly entry point. /// </summary> private static int Main(string[] args) { /*xxxargs = new[] { @"Command=ReportToUsers", @"TfsServerUri=http://rufrt-vxbuild:8080/tfs/sed", @"CutoffDays=0", @"[email protected]", };*/ try { Arguments arguments = new Arguments(args); using (var tfsGateway = new TeamFoundationServerGateway(arguments.TfsServerUri)) { using (var mailGateway = MailGatewayFactory.CreateGateway(new MailAddress(Resources.MailSenderAddress, Resources.MailSenderName))) { return (new Program(tfsGateway, mailGateway, arguments.CutoffTimeSpan)).Run(arguments); } } } catch (Exception e) { return ErrorHandler.Runtime(e); } }