Example #1
0
        /// <summary>
        /// Handles a click event on the Chorus Hub button
        /// (Shared folder mode is used for only testing purposes)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void _useLocalNetworkButton_Click(object sender, EventArgs e)
        {
            if (RepositoryChosen != null)
            {
                RepositoryAddress address;

                if (_lanMode == LANMode.Folder)                 // used for only testing
                {
                    address = _repository.GetDefaultNetworkAddress <DirectoryRepositorySource>();
                }
                else                 // if (_lanMode == LANMode.ChorusHub)
                {
                    Cursor.Current = Cursors.WaitCursor;
                    string directoryName = Path.GetFileName(_repository.PathToRepo);
                    var    doWait        = _chorusHubClient.PrepareHubToSync(directoryName, _repository.Identifier);
                    if (doWait)
                    {
                        // TODO: show indeterminate progress bar for this wait
                        Thread.Sleep(WAIT_CREATE_CH_REPO);
                    }
                    address = new ChorusHubRepositorySource(_chorusHubServerInfo.HostName,
                                                            _chorusHubServerInfo.GetHgHttpUri(RepositoryAddress.ProjectNameVariable), false,
                                                            _chorusHubClient.GetRepositoryInformation(null));
                    Cursor.Current = Cursors.Default;
                }
                RepositoryChosen.Invoke(this, new SyncStartArgs(address, _commitMessageText.Text));
            }
        }
Example #2
0
        public void SetUp()
        {
            // represents a normal repo
            _normalRepo = new RepositoryInformation("AnotherProjectName", "RepoId1");
            // represents a repo that already exists when a project with the same name is added
            _duplicateRepo = new RepositoryInformation("DuplicateProject", "RepoId3");
            // represents a new repo with the same name as the project being added;
            // also represents a new repo with a name derived from the name of the duplicate project
            _newRepo = new RepositoryInformation("DuplicateProject2", RepositoryInformation.NEW_REPO);

            _repositoryInformations = new List <RepositoryInformation>
            {
                new RepositoryInformation("ProjectName", "RepoId"),
                _normalRepo,
                new RepositoryInformation("DifferentProjectName", "RepoId2"),
                _duplicateRepo,
                new RepositoryInformation("DuplicateProject1", "RepoId4"),
                new RepositoryInformation("DuplicateProjectNot", RepositoryInformation.NEW_REPO),
                _newRepo
            };

            _source = new ChorusHubRepositorySource("localhost",
                                                    _chorusHubURL + RepositoryAddress.ProjectNameVariable,
                                                    false, _repositoryInformations);
        }