Ejemplo n.º 1
0
        private void DeleteClick(object sender, EventArgs e)
        {
            if (_selectedRemote == null)
            {
                return;
            }

            if (MessageBox.Show(this,
                                _questionDeleteRemote.Text,
                                _questionDeleteRemoteCaption.Text,
                                MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                var output = _remoteManager.RemoveRemote(_selectedRemote);
                if (!string.IsNullOrEmpty(output))
                {
                    MessageBox.Show(this, output, _gitMessage.Text);
                }

                // Deleting a remote from the history list may be undesirable as
                // it would hinder user's ability to *quickly* clone the remote repository
                // The flipside is that the history list may grow long without a UI to manage it

                Initialize();
            }
        }
Ejemplo n.º 2
0
        private void DeleteClick(object sender, EventArgs e)
        {
            if (_selectedRemote == null)
            {
                return;
            }

            if (DialogResult.Yes == MessageBox.Show(this,
                                                    _questionDeleteRemote.Text,
                                                    _questionDeleteRemoteCaption.Text,
                                                    MessageBoxButtons.YesNo))
            {
                var output = _remoteManager.RemoveRemote(_selectedRemote);
                if (!string.IsNullOrEmpty(output))
                {
                    MessageBox.Show(this, output, _gitMessage.Text);
                }

                Initialize();
            }
        }
 public void RemoveRemote_should_throw_if_remote_is_null()
 {
     ((Action)(() => _controller.RemoveRemote(null))).Should().Throw <ArgumentNullException>()
     .WithMessage("Value cannot be null.\r\nParameter name: remote");
 }