public ChorusHubWindow(ChorusHubParameters parameters) { InitializeComponent(); _service = new ChorusHubService(parameters) {Progress = _logBox}; _logBox.ShowDetailsMenuItem = true; _logBox.ShowCopyToClipboardMenuItem = true; }
private static void SetupErrorHandling(ChorusHubParameters chorusHubParameters) { ErrorReport.EmailAddress = "*****@*****.**"; ErrorReport.AddProperty("Application", "ChorusHub"); ErrorReport.AddProperty("Directory", chorusHubParameters.RootDirectory); ErrorReport.AddProperty("AdvertisingPort", ChorusHubParameters.kAdvertisingPort.ToString()); ErrorReport.AddProperty("MercurialPort", ChorusHubParameters.kMercurialPort.ToString()); ErrorReport.AddStandardProperties(); ExceptionHandler.Init(); }
static void Main(string[] args) { var parameters = new ChorusHubParameters(); if(Parser.ParseHelp(args)) { MessageBox.Show(Parser.ArgumentsUsage(parameters.GetType()),"Chorus Hub Command Line Parameters"); return; } if (!Parser.ParseArguments(args, parameters, ShowCommandLineError)) { return; } string parentOfRoot = Path.GetDirectoryName(parameters.RootDirectory); if(!Path.IsPathRooted(parameters.RootDirectory)) { ErrorReport.NotifyUserOfProblem("You supplied '{0}' for the root directory, but that doesn't have a drive letter.", parameters.RootDirectory); return; } if(!Directory.Exists(parentOfRoot)) { ErrorReport.NotifyUserOfProblem("In order to use '{0}', '{1}' must already exist", parameters.RootDirectory, parentOfRoot); return; } var server = new ChorusHubClient().FindServer(); if (server != null) { ErrorReport.NotifyUserOfProblem("Only one ChorusHub can be run on a network but there is already one running on {0}", server.HostName); return; } SetupErrorHandling(parameters); SetUpReporting(); Application.Run(mainForm: new ChorusHubWindow(parameters)); }
public ChorusHubService(ChorusHubParameters parameters) { Parameters = parameters; ServicePort = ChorusHubParameters.kServicePort; }