Exemplo n.º 1
0
        protected override async Task Save()
        {
            if (string.IsNullOrEmpty(Title))
            {
                throw new Exception("Unable to save the issue: you must provide a title!");
            }

            try
            {
                var assignedTo = AssignedTo == null ? null : AssignedTo.Login;
                int?milestone  = null;
                if (Milestone != null)
                {
                    milestone = Milestone.Number;
                }
                var labels  = Labels.Select(x => x.Name).ToArray();
                var content = Content ?? string.Empty;

                var data = await _applicationService.Client.ExecuteAsync(_applicationService.Client.Users[RepositoryOwner].Repositories[RepositoryName].Issues.Create(Title, content, assignedTo, milestone, labels));

                _createdIssueSubject.OnNext(data.Data);
                DismissCommand.ExecuteIfCan();
            }
            catch (Exception e)
            {
                throw new Exception("Unable to save new issue! Please try again.", e);
            }
        }
Exemplo n.º 2
0
        public LoginViewModel(INetworkActivityService networkActivity)
        {
            LoginCommand = ReactiveCommand.CreateAsyncTask(async t =>
            {
                var account = new Account();

                var connection = new Octokit.Connection(new Octokit.ProductHeaderValue("RepoStumble"));
                var client     = new Octokit.OauthClient(connection);
                var token      = await client.CreateAccessToken(new Octokit.OauthTokenRequest(ClientId, ClientSecret, LoginCode));

                connection.Credentials = new Octokit.Credentials(token.AccessToken);
                var githubClient       = new Octokit.GitHubClient(connection);
                var info          = await githubClient.User.Current();
                account.AvatarUrl = info.AvatarUrl;
                account.Username  = info.Login;
                account.Fullname  = info.Name;
                account.OAuth     = token.AccessToken;
                account.Save();

                DismissCommand.ExecuteIfCan();
            });

            LoginCommand.IsExecuting.Skip(1).Where(x => x).Subscribe(x => networkActivity.PushNetworkActive());
            LoginCommand.IsExecuting.Skip(1).Where(x => !x).Subscribe(x => networkActivity.PopNetworkActive());
        }
Exemplo n.º 3
0
        protected MarkdownComposerViewModel(IStatusIndicatorService status, IAlertDialogService alert, IJsonHttpClientService jsonClient)
        {
            var saveCommand = ReactiveCommand.CreateAsyncTask(
                this.WhenAnyValue(x => x.Text).Select(x => !string.IsNullOrEmpty(x)),
                t => Save());

            saveCommand.IsExecuting.Where(x => x).Subscribe(_ => status.Show("Saving..."));
            saveCommand.IsExecuting.Where(x => !x).Subscribe(_ => status.Hide());
            saveCommand.Subscribe(x => DismissCommand.ExecuteIfCan());
            SaveCommand = saveCommand;

            PostToImgurCommand =
                ReactiveCommand.CreateAsyncTask(async data =>
            {
                var uploadData = data as byte[];
                if (uploadData == null)
                {
                    throw new Exception("There is no data to upload!");
                }

                return(await jsonClient.Post <ImgurModel>("https://api.imgur.com/3/image",
                                                          new { image = Convert.ToBase64String(uploadData) },
                                                          new Dictionary <string, string> {
                    { "Authorization", "Client-ID " + AuthorizationClientId }
                }));
            });

            PostToImgurCommand.IsExecuting.Where(x => x).Subscribe(_ => status.Show("Uploading..."));
            PostToImgurCommand.IsExecuting.Where(x => !x).Subscribe(_ => status.Hide());
            PostToImgurCommand.ThrownExceptions.SubscribeSafe(e => alert.Alert("Error", "Unable to upload image: " + e.Message));
        }
Exemplo n.º 4
0
        public GistCreateViewModel(IApplicationService applicationService)
        {
            _applicationService = applicationService;

            Title = "Create Gist";
            Files = new Dictionary <string, string>();

            SaveCommand = ReactiveCommand.CreateAsyncTask(async t =>
            {
                if (_files == null || _files.Count == 0)
                {
                    throw new Exception("You cannot create a Gist without atleast one file! Please correct and try again.");
                }

                var createGist = new GistCreateModel
                {
                    Description = Description,
                    Public      = IsPublic,
                    Files       = Files.ToDictionary(x => x.Key, x => new GistCreateModel.File {
                        Content = x.Value
                    })
                };

                var request = _applicationService.Client.AuthenticatedUser.Gists.CreateGist(createGist);
                _createdGistSubject.OnNext((await _applicationService.Client.ExecuteAsync(request)).Data);
                DismissCommand.ExecuteIfCan();
            });
        }
Exemplo n.º 5
0
	    protected override async Task Save()
		{
            if (string.IsNullOrEmpty(Title))
                throw new Exception("Issue must have a title!");

			try
			{
				var assignedTo = AssignedTo == null ? null : AssignedTo.Login;
				int? milestone = null;
				if (Milestone != null) 
					milestone = Milestone.Number;
				var labels = Labels.Select(x => x.Name).ToArray();
				var content = Content ?? string.Empty;
				var state = IsOpen ? "open" : "closed";
				var retried = false;

				// For some reason github needs to try again during an internal server error
				tryagain:

				try
				{
                    var data = await _applicationService.Client.ExecuteAsync(_applicationService.Client.Users[RepositoryOwner].Repositories[RepositoryName].Issues[Issue.Number].Update(Title, content, state, assignedTo, milestone, labels));
				    Issue = data.Data;
				}
				catch (GitHubSharp.InternalServerException)
				{
					if (retried)
						throw;

					//Do nothing. Something is wrong with github's service
					retried = true;
					goto tryagain;
				}

				DismissCommand.ExecuteIfCan();
			}
			catch (Exception e)
			{
                throw new Exception("Unable to save the issue! Please try again", e);
			}

//			//There is a wierd bug in GitHub when editing an existing issue and the assignedTo is null
//			catch (GitHubSharp.InternalServerException)
//			{
//				if (ExistingIssue != null && assignedTo == null)
//					tryEditAgain = true;
//				else
//					throw;
//			}
//
//			if (tryEditAgain)
//			{
//				var response = await Application.Client.ExecuteAsync(Application.Client.Users[Username].Repositories[RepoSlug].Issues[ExistingIssue.Number].Update(title, content, state, assignedTo, milestone, labels)); 
//				model = response.Data;
//			}
		}
Exemplo n.º 6
0
 public CommitMessageViewModel(IApplicationService applicationService)
 {
     SaveCommand = ReactiveCommand.CreateAsyncTask(
         this.WhenAnyValue(x => x.Message).Select(x => !string.IsNullOrEmpty(x)),
         async _ =>
     {
         var request = applicationService.Client.Users[Username].Repositories[Repository]
                       .UpdateContentFile(Path, Message, Text, BlobSha, Branch);
         var response = await applicationService.Client.ExecuteAsync(request);
         _contentSubject.OnNext(response.Data);
         DismissCommand.ExecuteIfCan();
     });
 }
Exemplo n.º 7
0
        public AccountsViewModel(IAccountsService accountsService)
        {
            _accountsService = accountsService;

            Title = "Accounts";

            _accounts = new ReactiveList <GitHubAccount>(accountsService.OrderBy(x => x.Username));
            this.WhenActivated(d => _accounts.Reset(accountsService.OrderBy(x => x.Username)));
            Accounts = _accounts.CreateDerivedCollection(CreateAccountItem);

            this.WhenAnyValue(x => x.ActiveAccount)
            .Subscribe(x =>
            {
                foreach (var account in Accounts)
                {
                    account.Selected = Equals(account.Account, x);
                }
            });

            DeleteAccountCommand = ReactiveCommand.Create();
            DeleteAccountCommand.OfType <GitHubAccount>().Subscribe(x =>
            {
                if (Equals(accountsService.ActiveAccount, x))
                {
                    ActiveAccount = null;
                }
                accountsService.Remove(x);
                _accounts.Remove(x);
            });

            LoginCommand = ReactiveCommand.Create();
            LoginCommand.OfType <GitHubAccount>().Subscribe(x =>
            {
                if (Equals(accountsService.ActiveAccount, x))
                {
                    DismissCommand.ExecuteIfCan();
                }
                else
                {
                    ActiveAccount = x;
                    MessageBus.Current.SendMessage(new LogoutMessage());
                    DismissCommand.ExecuteIfCan();
                }
            });

            DismissCommand = ReactiveCommand.Create(this.WhenAnyValue(x => x.ActiveAccount).Select(x => x != null))
                             .WithSubscription(x => base.DismissCommand.ExecuteIfCan(x));

            GoToAddAccountCommand = ReactiveCommand.Create()
                                    .WithSubscription(_ => ShowViewModel(CreateViewModel <NewAccountViewModel>()));
        }
Exemplo n.º 8
0
        public PurchaseProViewModel(IFeaturesService featuresService)
        {
            var purchaseCommand = ReactiveCommand.CreateAsyncTask(x => featuresService.EnableProEdition());

            purchaseCommand.Subscribe(_ => DismissCommand.ExecuteIfCan());
            PurchaseCommand = purchaseCommand;

            var restoreCommand = ReactiveCommand.CreateAsyncTask(x => featuresService.RestorePurchase());

            restoreCommand.Subscribe(_ => DismissCommand.ExecuteIfCan());
            RestoreCommand = restoreCommand;

            GetPrice(featuresService);
        }
Exemplo n.º 9
0
        public MyIssuesFilterViewModel(IActionMenuFactory actionMenu)
        {
            Title      = "Filter";
            State      = IssueState.Open;
            SortType   = IssueSort.None;
            FilterType = IssueFilterState.All;

            SaveCommand = ReactiveCommand.CreateAsyncTask(_ => Task.FromResult(new MyIssuesFilterModel(FilterType, State, SortType, Labels, Ascending)));
            SaveCommand.Subscribe(_ => DismissCommand.ExecuteIfCan());
            DismissCommand = ReactiveCommand.Create().WithSubscription(_ => Dismiss());

            SelectStateCommand = ReactiveCommand.CreateAsyncTask(async sender => {
                var options = Enum.GetValues(typeof(IssueState)).Cast <IssueState>().ToList();
                var picker  = actionMenu.CreatePicker();
                foreach (var option in options)
                {
                    picker.Options.Add(option.Humanize());
                }
                picker.SelectedOption = options.IndexOf(State);
                var ret = await picker.Show(sender);
                State   = options[ret];
            });

            SelectSortCommand = ReactiveCommand.CreateAsyncTask(async sender => {
                var options = Enum.GetValues(typeof(IssueSort)).Cast <IssueSort>().ToList();
                var picker  = actionMenu.CreatePicker();
                foreach (var option in options)
                {
                    picker.Options.Add(option.Humanize());
                }
                picker.SelectedOption = options.IndexOf(SortType);
                var ret  = await picker.Show(sender);
                SortType = options[ret];
            });

            SelectFilterTypeCommand = ReactiveCommand.CreateAsyncTask(async sender => {
                var options = Enum.GetValues(typeof(IssueFilterState)).Cast <IssueFilterState>().ToList();
                var picker  = actionMenu.CreatePicker();
                foreach (var option in options)
                {
                    picker.Options.Add(option.Humanize());
                }
                picker.SelectedOption = options.IndexOf(FilterType);
                var ret    = await picker.Show(sender);
                FilterType = options[ret];
            });
        }
Exemplo n.º 10
0
        public IssueLabelsViewModel(IApplicationService applicationService)
        {
            Labels         = new ReactiveList <LabelModel>();
            SelectedLabels = new ReactiveList <LabelModel>();

            SelectLabelsCommand = ReactiveCommand.CreateAsyncTask(async t =>
            {
                var selectedLabels = t as IEnumerable <LabelModel>;
                if (selectedLabels != null)
                {
                    SelectedLabels.Reset(selectedLabels);
                }

                //If nothing has changed, dont do anything...
                if (OriginalLabels != null && OriginalLabels.Count() == SelectedLabels.Count() &&
                    OriginalLabels.Intersect(SelectedLabels).Count() == SelectedLabels.Count())
                {
                    DismissCommand.ExecuteIfCan();
                    return;
                }

                if (SaveOnSelect)
                {
                    try
                    {
                        var labels = (SelectedLabels != null && SelectedLabels.Count > 0)
                                    ? SelectedLabels.Select(y => y.Name).ToArray() : null;
                        var updateReq =
                            applicationService.Client.Users[RepositoryOwner].Repositories[RepositoryName].Issues[IssueId]
                            .UpdateLabels(labels);
                        await applicationService.Client.ExecuteAsync(updateReq);
                    }
                    catch (Exception e)
                    {
                        throw new Exception("Unable to save labels! Please try again.", e);
                    }
                }

                DismissCommand.ExecuteIfCan();
            });

            LoadCommand = ReactiveCommand.CreateAsyncTask(t =>
                                                          Labels.SimpleCollectionLoad(
                                                              applicationService.Client.Users[RepositoryOwner].Repositories[RepositoryName].Labels.GetAll(),
                                                              t as bool?));
        }
Exemplo n.º 11
0
        protected DefaultStartupViewModel(IAccountsService accountsService, Type menuViewModelType)
        {
            StartupViews    = new ReactiveCollection <string>();
            AccountsService = accountsService;

            SelectedStartupView = AccountsService.ActiveAccount.DefaultStartupView;
            this.WhenAnyValue(x => x.SelectedStartupView).Skip(1).Subscribe(x =>
            {
                AccountsService.ActiveAccount.DefaultStartupView = x;
                AccountsService.Update(AccountsService.ActiveAccount);
                DismissCommand.ExecuteIfCan();
            });

            StartupViews.Reset(from p in menuViewModelType.GetProperties()
                               let attr = p.GetCustomAttributes(typeof(PotentialStartupViewAttribute), true)
                                          where attr.Length == 1 && attr[0] is PotentialStartupViewAttribute
                                          select((PotentialStartupViewAttribute)attr[0]).Name);
        }
Exemplo n.º 12
0
        public DefaultStartupViewModel(IAccountsService accountsService)
        {
            AccountsService = accountsService;
            var menuViewModelType = typeof(MenuViewModel);

            SelectedStartupView = AccountsService.ActiveAccount.DefaultStartupView;
            this.WhenAnyValue(x => x.SelectedStartupView).Skip(1).Subscribe(x =>
            {
                AccountsService.ActiveAccount.DefaultStartupView = x;
                AccountsService.Update(AccountsService.ActiveAccount);
                DismissCommand.ExecuteIfCan();
            });

            StartupViews = new ReactiveList <string>(from p in menuViewModelType.GetRuntimeProperties()
                                                     let attr = p.GetCustomAttributes(typeof(PotentialStartupViewAttribute), true).ToList()
                                                                where attr.Count == 1 && attr[0] is PotentialStartupViewAttribute
                                                                select((PotentialStartupViewAttribute)attr[0]).Name);
        }
Exemplo n.º 13
0
        public FeedbackComposerViewModel(IApplicationService applicationService, IImgurService imgurService,
                                         IMediaPickerService mediaPicker, IStatusIndicatorService statusIndicatorService, IAlertDialogService alertDialogService)
        {
            this.WhenAnyValue(x => x.IsFeature).Subscribe(x => Title = x ? "New Feature" : "Bug Report");

            SubmitCommand = ReactiveCommand.CreateAsyncTask(
                this.WhenAnyValue(x => x.Subject).Select(x => !string.IsNullOrEmpty(x)),
                async _ =>
            {
                if (string.IsNullOrEmpty(Subject))
                {
                    throw new ArgumentException(string.Format("You must provide a title for this {0}!", IsFeature ? "feature" : "bug"));
                }
                var labels       = await applicationService.Client.ExecuteAsync(applicationService.Client.Users[CodeHubOwner].Repositories[CodeHubName].Labels.GetAll());
                var createLabels = labels.Data.Where(x => string.Equals(x.Name, IsFeature ? "feature request" : "bug", StringComparison.OrdinalIgnoreCase)).Select(x => x.Name).Distinct();
                var request      = applicationService.Client.Users[CodeHubOwner].Repositories[CodeHubName].Issues.Create(Subject, Description, null, null, createLabels.ToArray());
                var createdIssue = await applicationService.Client.ExecuteAsync(request);
                _createdIssueSubject.OnNext(createdIssue.Data);
                DismissCommand.ExecuteIfCan();
            });

            PostToImgurCommand = ReactiveCommand.CreateAsyncTask(async _ =>
            {
                var photo        = await mediaPicker.PickPhoto();
                var memoryStream = new MemoryStream();
                await photo.Save(Splat.CompressedBitmapFormat.Jpeg, 0.8f, memoryStream);
                using (statusIndicatorService.Activate("Uploading..."))
                {
                    var model = await imgurService.SendImage(memoryStream.ToArray());
                    if (model == null || model.Data == null || model.Data.Link == null)
                    {
                        throw new InvalidOperationException("Unable to upload to Imgur. Please try again later.");
                    }
                    return(model.Data.Link);
                }
            });

            PostToImgurCommand.ThrownExceptions
            .Where(x => !(x is TaskCanceledException))
            .Subscribe(x => alertDialogService.Alert("Upload Error", x.Message));
        }
Exemplo n.º 14
0
        public IssueMilestonesViewModel(IApplicationService applicationService)
        {
            Milestones = new ReactiveList <MilestoneModel>();

            SelectMilestoneCommand = ReactiveCommand.CreateAsyncTask(async t =>
            {
                var milestone = t as MilestoneModel;
                if (milestone != null)
                {
                    SelectedMilestone = milestone;
                }

                if (SaveOnSelect)
                {
                    try
                    {
                        int?milestoneNumber = null;
                        if (SelectedMilestone != null)
                        {
                            milestoneNumber = SelectedMilestone.Number;
                        }
                        var updateReq = applicationService.Client.Users[RepositoryOwner].Repositories[RepositoryName].Issues[IssueId].UpdateMilestone(milestoneNumber);
                        await applicationService.Client.ExecuteAsync(updateReq);
                    }
                    catch (Exception e)
                    {
                        throw new Exception("Unable to to save milestone! Please try again.", e);
                    }
                }

                DismissCommand.ExecuteIfCan();
            });

            LoadCommand = ReactiveCommand.CreateAsyncTask(t =>
                                                          Milestones.SimpleCollectionLoad(
                                                              applicationService.Client.Users[RepositoryOwner].Repositories[RepositoryName].Milestones.GetAll(),
                                                              t as bool?));
        }
Exemplo n.º 15
0
        public AccountsViewModel(IAccountsService accountsService)
        {
            _accountsService      = accountsService;
            Accounts              = new ReactiveList <IAccount>(accountsService);
            LoginCommand          = new ReactiveCommand();
            GoToAddAccountCommand = new ReactiveCommand();
            DeleteAccountCommand  = new ReactiveCommand();

            DeleteAccountCommand.OfType <IAccount>().Subscribe(x =>
            {
                if (Equals(accountsService.ActiveAccount, x))
                {
                    ActiveAccount = null;
                }
                accountsService.Remove(x);
                Accounts.Remove(x);
            });

            LoginCommand.OfType <IAccount>().Subscribe(x =>
            {
                if (Equals(accountsService.ActiveAccount, x))
                {
                    DismissCommand.ExecuteIfCan();
                }
                else
                {
                    ActiveAccount = x;
                    MessageBus.Current.SendMessage(new LogoutMessage());
                    DismissCommand.ExecuteIfCan();
                }
            });

            GoToAddAccountCommand.Subscribe(_ => ShowViewModel(CreateViewModel(typeof(IAddAccountViewModel))));

            LoadCommand = new ReactiveCommand();
            LoadCommand.Subscribe(x => Accounts.Reset(accountsService));
        }
Exemplo n.º 16
0
        public IssueAssignedToViewModel(IApplicationService applicationService)
        {
            _applicationService = applicationService;
            Users = new ReactiveList<BasicUserModel>();

            SelectUserCommand = ReactiveCommand.CreateAsyncTask(async t =>
            {
                var selectedUser = t as BasicUserModel;
                if (selectedUser != null)
                    SelectedUser = selectedUser;

                if (SaveOnSelect)
                {
                    var assignee = SelectedUser != null ? SelectedUser.Login : null;
                    var updateReq = _applicationService.Client.Users[RepositoryOwner].Repositories[RepositoryName].Issues[IssueId].UpdateAssignee(assignee);
                    await _applicationService.Client.ExecuteAsync(updateReq);
                }

                DismissCommand.ExecuteIfCan();
            });

            LoadCommand = ReactiveCommand.CreateAsyncTask(t => 
                Users.SimpleCollectionLoad(applicationService.Client.Users[RepositoryOwner].Repositories[RepositoryName].GetAssignees(), t as bool?));
        }
Exemplo n.º 17
0
        public IssueLabelsViewModel(IApplicationService applicationService, IGraphicService graphicService)
        {
            var labels = new ReactiveList <LabelModel>();

            SelectedLabels = new ReactiveList <LabelModel>();

            Labels = labels.CreateDerivedCollection(x =>
            {
                var vm = new IssueLabelItemViewModel(graphicService, x);
                vm.SelectCommand.Subscribe(_ =>
                {
                    var selected = SelectedLabels.FirstOrDefault(y => string.Equals(y.Name, x.Name));
                    if (selected != null)
                    {
                        SelectedLabels.Remove(selected);
                        vm.Selected = false;
                    }
                    else
                    {
                        SelectedLabels.Add(x);
                        vm.Selected = true;
                    }
                });
                return(vm);
            });

            SelectLabelsCommand = ReactiveCommand.CreateAsyncTask(async t =>
            {
                var selectedLabels = t as IEnumerable <LabelModel>;
                if (selectedLabels != null)
                {
                    SelectedLabels.Reset(selectedLabels);
                }

                //If nothing has changed, dont do anything...
                if (OriginalLabels != null && OriginalLabels.Count() == SelectedLabels.Count() &&
                    OriginalLabels.Intersect(SelectedLabels).Count() == SelectedLabels.Count())
                {
                    DismissCommand.ExecuteIfCan();
                    return;
                }

                if (SaveOnSelect)
                {
//	                try
//	                {
//                        var labels = (SelectedLabels != null && SelectedLabels.Count > 0)
//                                    ? SelectedLabels.Select(y => y.Name).ToArray() : null;
//	                    var updateReq =
//	                        applicationService.Client.Users[RepositoryOwner].Repositories[RepositoryName].Issues[IssueId]
//	                            .UpdateLabels(labels);
//                        await applicationService.Client.ExecuteAsync(updateReq);
//	                }
//	                catch (Exception e)
//	                {
//	                    throw new Exception("Unable to save labels! Please try again.", e);
//	                }
                }

                DismissCommand.ExecuteIfCan();
            });

            LoadCommand = ReactiveCommand.CreateAsyncTask(t =>
                                                          labels.LoadAll(applicationService.Client.Users[RepositoryOwner].Repositories[RepositoryName].Labels.GetAll()));
        }
Exemplo n.º 18
0
        public LoginViewModel(ILoginService loginFactory,
                              IAccountsService accountsService,
                              IActionMenuService actionMenuService,
                              IStatusIndicatorService statusIndicatorService,
                              IAlertDialogService alertDialogService)
        {
            _loginFactory = loginFactory;

            Title = "Login";

            GoToOldLoginWaysCommand = ReactiveCommand.Create();
            GoToOldLoginWaysCommand.Subscribe(_ => ShowViewModel(CreateViewModel <AddAccountViewModel>()));

            var loginCommand = ReactiveCommand.CreateAsyncTask(
                this.WhenAnyValue(x => x.Code).Select(x => !string.IsNullOrEmpty(x)), _ => Login(Code));

            loginCommand.Subscribe(x => accountsService.ActiveAccount = x);
            loginCommand.Subscribe(x => MessageBus.Current.SendMessage(new LogoutMessage()));
            LoginCommand = loginCommand;

            ShowLoginOptionsCommand = ReactiveCommand.CreateAsyncTask(t =>
            {
                var actionMenu = actionMenuService.Create(Title);
                actionMenu.AddButton("Login via BASIC", GoToOldLoginWaysCommand);
                return(actionMenu.Show());
            });

            LoginCommand.IsExecuting.Skip(1).Subscribe(x =>
            {
                if (x)
                {
                    statusIndicatorService.Show("Logging in...");
                }
                else
                {
                    statusIndicatorService.Hide();
                }
            });

            _loginUrl = this.WhenAnyValue(x => x.WebDomain)
                        .IsNotNull()
                        .Select(x => x.TrimEnd('/'))
                        .Select(x =>
                                string.Format(x + "/login/oauth/authorize?client_id={0}&redirect_uri={1}&scope={2}",
                                              ClientId, Uri.EscapeDataString(RedirectUri), Uri.EscapeDataString("user,repo,notifications,gist")))
                        .ToProperty(this, x => x.LoginUrl);

            LoadCommand = ReactiveCommand.CreateAsyncTask(async t =>
            {
                if (IsEnterprise && string.IsNullOrEmpty(WebDomain))
                {
                    var response = await alertDialogService.PromptTextBox("Enterprise URL",
                                                                          "Please enter the webpage address for the GitHub Enterprise installation",
                                                                          DefaultWebDomain, "Ok");
                    WebDomain = response;
                }
                else
                {
                    WebDomain = DefaultWebDomain;
                }
            });

            LoadCommand.ThrownExceptions.Take(1).Subscribe(x => DismissCommand.ExecuteIfCan());
        }