Esempio n. 1
0
        private async Task CloneAsync()
        {
            if (string.IsNullOrWhiteSpace(_url) || string.IsNullOrWhiteSpace(_path))
            {
                return;
            }
            var repository = new Repository();
            var error      = string.Empty;

            try
            {
                var result = await _gitManager.CloneAsync(_url, _path, _name).ConfigureAwait(false);

                repository = result.Item1;
                error      = result.Item2;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            if (repository == null)
            {
                MessageBox.Show(error);
                return;
            }
            Application.Current.Dispatcher.Invoke(delegate
            {
                _repositories.Add(repository);
            });
            URL  = "";
            Path = "";
            Name = "";
        }