Ejemplo n.º 1
0
 public ChorusHubWindow(ChorusHubParameters parameters)
 {
     InitializeComponent();
     _service = new ChorusHubService(parameters) {Progress = _logBox};
     _logBox.ShowDetailsMenuItem = true;
     _logBox.ShowCopyToClipboardMenuItem = true;
 }
Ejemplo n.º 2
0
 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();
 }
Ejemplo n.º 3
0
        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));
        }
Ejemplo n.º 4
0
 public ChorusHubService(ChorusHubParameters parameters)
 {
     Parameters = parameters;
     ServicePort = ChorusHubParameters.kServicePort;
 }