Example #1
0
 /// <summary>
 /// Called when the <see cref="SignIn"/> command is executed.
 /// </summary>
 void OnSignIn()
 {
     // Show the Sign In dialog. We don't need to listen to the outcome of this: the parent
     // GitHubPaneViewModel will listen to RepositoryHosts.IsLoggedInToAnyHost and close
     // this view when the user logs in.
     uiProvider.SetupUI(UIControllerFlow.Authentication, null);
     uiProvider.RunUI();
 }
Example #2
0
        CloneRequest ShowCloneDialog(IUIProvider uiProvider, IGitRepositoriesExt gitRepositories, ISimpleRepositoryModel repository = null)
        {
            string basePath = null;

            uiProvider.AddService(this, gitRepositories);

            var load = uiProvider.SetupUI(repository == null ? UIControllerFlow.Clone : UIControllerFlow.StartPageClone,
                                          null //TODO: set the connection corresponding to the repository if the repository is not null
                                          );

            load.Subscribe(x =>
            {
                if ((repository == null && x.Data.ViewType == Exports.UIViewType.Clone) ||       // fire the normal clone dialog
                    (repository != null && x.Data.ViewType == Exports.UIViewType.StartPageClone) // fire the clone dialog for re-acquiring a repo
                    )
                {
                    var vm = x.View.ViewModel as IBaseCloneViewModel;
                    if (repository != null)
                    {
                        vm.SelectedRepository = repository;
                    }
                    x.View.Done.Subscribe(_ =>
                    {
                        basePath = vm.BaseRepositoryPath;
                        if (repository == null)
                        {
                            repository = vm.SelectedRepository;
                        }
                    });
                }
            });

            uiProvider.RunUI();
            uiProvider.RemoveService(typeof(IGitRepositoriesExt), this);

            return(new CloneRequest(basePath, repository));
        }
Example #3
0
 public IObservable <LoadData> SetupUI(UIControllerFlow controllerFlow, IConnection connection) => theRealProvider.SetupUI(controllerFlow, connection);