public TeamExplorerSectionBase(ISimpleApiClientFactory apiFactory, ITeamExplorerServiceHolder holder)
     : base(apiFactory, holder)
 {
     IsVisible = false;
     IsEnabled = true;
     IsExpanded = true;
 }
Ejemplo n.º 2
0
 public GitHubConnectSection0(ISimpleApiClientFactory apiFactory,
     ITeamExplorerServiceHolder holder,
     IConnectionManager manager,
     IPackageSettings settings)
     : base(apiFactory, holder, manager, settings, 0)
 {
 }
 public TeamExplorerSectionBase(ITeamExplorerServiceHolder holder)
     : base(holder)
 {
     IsVisible = false;
     IsEnabled = true;
     IsExpanded = true;
 }
 PullRequestListViewModel(
     IConnectionRepositoryHostMap connectionRepositoryHostMap,
     ITeamExplorerServiceHolder teservice,
     IPackageSettings settings)
     : this(connectionRepositoryHostMap.CurrentRepositoryHost, teservice.ActiveRepo, settings)
 {
 }
 public GitHubHomeSection(ISimpleApiClientFactory apiFactory, ITeamExplorerServiceHolder holder)
     : base(apiFactory, holder)
 {
     Title = "GitHub";
     View = new GitHubHomeContent();
     View.DataContext = this;
 }
 public EnsureLoggedInSection(ISimpleApiClientFactory apiFactory, ITeamExplorerServiceHolder holder,
     IConnectionManager cm, IRepositoryHosts hosts, IVSServices vsServices)
     : base(apiFactory, holder, cm)
 {
     IsVisible = false;
     this.hosts = hosts;
     this.vsServices = vsServices;
 }
Ejemplo n.º 7
0
 public PulseNavigationItem(ISimpleApiClientFactory apiFactory, Lazy<IVisualStudioBrowser> browser,
                             ITeamExplorerServiceHolder holder)
     : base(apiFactory, holder, Octicon.pulse)
 {
     this.browser = browser;
     Text = "Pulse";
     ArgbColor = Colors.LightBlueNavigationItem.ToInt32();
 }
 public PullRequestsNavigationItem(ISimpleApiClientFactory apiFactory, Lazy<IVisualStudioBrowser> browser,
                             ITeamExplorerServiceHolder holder)
     : base(apiFactory, holder, Octicon.git_pull_request)
 {
     this.browser = browser;
     Text = Resources.PullRequestsNavigationItemText;
     ArgbColor = Colors.RedNavigationItem.ToInt32();
 }
 public WikiNavigationItem(ISimpleApiClientFactory apiFactory, Lazy<IVisualStudioBrowser> browser,
                             ITeamExplorerServiceHolder holder)
     : base(apiFactory, holder, Octicon.book)
 {
     this.browser = browser;
     Text = Resources.WikiNavigationItemText;
     ArgbColor = Colors.BlueNavigationItem.ToInt32();
 }
 public PullRequestsNavigationItem(ISimpleApiClientFactory apiFactory, 
         ITeamExplorerServiceHolder holder, IMenuProvider menuProvider)
     : base(apiFactory, holder, Octicon.git_pull_request)
 {
     this.menuProvider = menuProvider;
     Text = Resources.PullRequestsNavigationItemText;
     ArgbColor = Colors.RedNavigationItem.ToInt32();
 }
 PullRequestDetailViewModel(
     IConnectionRepositoryHostMap connectionRepositoryHostMap,
     ITeamExplorerServiceHolder teservice,
     IPullRequestService pullRequestsService,
     IPackageSettings settings)
     : this(teservice.ActiveRepo,
           connectionRepositoryHostMap.CurrentRepositoryHost.ModelService,
           pullRequestsService,
           settings)
 {
 }
Ejemplo n.º 12
0
        public GitHubConnectSection(ISimpleApiClientFactory apiFactory, ITeamExplorerServiceHolder holder, IConnectionManager manager, int index)
            : base(apiFactory, holder, manager)
        {
            Title = "GitHub";
            IsEnabled = true;
            IsVisible = false;
            IsExpanded = true;
            LoggedIn = false;

            sectionIndex = index;

            connectionManager.Connections.CollectionChanged += RefreshConnections;
            PropertyChanged += OnPropertyChange;
            UpdateConnection();
        }
        public TeamExplorerNavigationItemBase(ISimpleApiClientFactory apiFactory, ITeamExplorerServiceHolder holder, Octicon octicon)
            : base(apiFactory, holder)
        {
            this.octicon = octicon;

            IsVisible = false;
            IsEnabled = true;

            OnThemeChanged();
            VSColorTheme.ThemeChanged += _ =>
            {
                OnThemeChanged();
            };

            holder.Subscribe(this, UpdateRepo);
        }
Ejemplo n.º 14
0
        public GitHubPaneViewModel(ISimpleApiClientFactory apiFactory, ITeamExplorerServiceHolder holder,
            IConnectionManager cm, IRepositoryHosts hosts, INotificationDispatcher notifications)
            : base(apiFactory, holder)
        {
            this.connectionManager = cm;
            this.hosts = hosts;
            syncContext = SynchronizationContext.Current;
            CancelCommand = ReactiveCommand.Create();
            Title = "GitHub";
            Message = String.Empty;

            this.WhenAnyValue(x => x.Control.DataContext)
                .OfType<BaseViewModel>()
                .Select(x => x.WhenAnyValue(y => y.Title))
                .Switch()
                .Subscribe(x => Title = x ?? "GitHub");
        }
Ejemplo n.º 15
0
        public GitHubPublishSection(ISimpleApiClientFactory apiFactory, ITeamExplorerServiceHolder holder,
            IConnectionManager cm, Lazy<IVisualStudioBrowser> browser,
            IRepositoryHosts hosts)
            : base(apiFactory, holder, cm)
        {

            lazyBrowser = browser;
            this.hosts = hosts;
            Title = Resources.GitHubPublishSectionTitle;
            Name = "GitHub";
            Provider = "GitHub, Inc";
            Description = Resources.BlurbText;
            ShowLogin = false;
            ShowSignup = false;
            ShowGetStarted = false;
            IsVisible = false;
            IsExpanded = true;
            InitializeSectionView();
        }
Ejemplo n.º 16
0
        public GitHubPublishSection(ISimpleApiClientFactory apiFactory, ITeamExplorerServiceHolder holder,
            IConnectionManager cm, Lazy<IVisualStudioBrowser> browser,
            IRepositoryHosts hosts)
            : base(apiFactory, holder, cm)
        {

            lazyBrowser = browser;
            this.hosts = hosts;
            Title = "Publish to GitHub";
            Name = "GitHub";
            Provider = "GitHub, Inc";
            Description = "Powerful collaboration, code review, and code management for open source and private projects.";
            ShowLogin = false;
            ShowSignup = false;
            ShowGetStarted = false;
            IsVisible = false;
            IsExpanded = true;
            var view = new GitHubInvitationContent();
            SectionContent = view;
            view.DataContext = this;
        }
        public TeamExplorerNavigationItemBase(IGitHubServiceProvider serviceProvider,
                                              ISimpleApiClientFactory apiFactory, ITeamExplorerServiceHolder holder, Octicon octicon)
            : base(serviceProvider, apiFactory, holder)
        {
            Guard.ArgumentNotNull(serviceProvider, nameof(serviceProvider));
            Guard.ArgumentNotNull(apiFactory, nameof(apiFactory));
            Guard.ArgumentNotNull(holder, nameof(holder));

            this.octicon = octicon;

            IsVisible = false;
            IsEnabled = true;

            OnThemeChanged();
            VSColorTheme.ThemeChanged += _ =>
            {
                OnThemeChanged();
                Invalidate();
            };

            holder.Subscribe(this, UpdateRepo);
        }
Ejemplo n.º 18
0
        public GitHubHomeSection(IGitHubServiceProvider serviceProvider,
                                 ISimpleApiClientFactory apiFactory,
                                 ITeamExplorerServiceHolder holder,
                                 IVisualStudioBrowser visualStudioBrowser,
                                 ITeamExplorerServices teamExplorerServices,
                                 IPackageSettings settings,
                                 IUsageTracker usageTracker)
            : base(serviceProvider, apiFactory, holder)
        {
            Title                     = "GitHub";
            View                      = new GitHubHomeContent();
            View.DataContext          = this;
            this.visualStudioBrowser  = visualStudioBrowser;
            this.teamExplorerServices = teamExplorerServices;
            this.settings             = settings;
            this.usageTracker         = usageTracker;

            var openOnGitHub = ReactiveCommand.Create();

            openOnGitHub.Subscribe(_ => DoOpenOnGitHub());
            OpenOnGitHub = openOnGitHub;
        }
        public GitHubConnectSection(IGitHubServiceProvider serviceProvider,
                                    ISimpleApiClientFactory apiFactory,
                                    ITeamExplorerServiceHolder holder,
                                    IConnectionManager manager,
                                    IPackageSettings packageSettings,
                                    IVSServices vsServices,
                                    IRepositoryCloneService cloneService,
                                    IDialogService dialogService,
                                    ILocalRepositories localRepositories,
                                    int index)
            : base(serviceProvider, apiFactory, holder, manager)
        {
            Guard.ArgumentNotNull(apiFactory, nameof(apiFactory));
            Guard.ArgumentNotNull(holder, nameof(holder));
            Guard.ArgumentNotNull(manager, nameof(manager));
            Guard.ArgumentNotNull(packageSettings, nameof(packageSettings));
            Guard.ArgumentNotNull(vsServices, nameof(vsServices));
            Guard.ArgumentNotNull(cloneService, nameof(cloneService));
            Guard.ArgumentNotNull(dialogService, nameof(dialogService));
            Guard.ArgumentNotNull(localRepositories, nameof(localRepositories));

            Title        = "GitHub";
            IsEnabled    = true;
            IsVisible    = false;
            LoggedIn     = false;
            sectionIndex = index;

            this.packageSettings   = packageSettings;
            this.vsServices        = vsServices;
            this.cloneService      = cloneService;
            this.dialogService     = dialogService;
            this.localRepositories = localRepositories;

            Clone = CreateAsyncCommandHack(DoClone);

            connectionManager.Connections.CollectionChanged += RefreshConnections;
            PropertyChanged += OnPropertyChange;
            UpdateConnection();
        }
Ejemplo n.º 20
0
        public GitHubPaneViewModel(IGitHubServiceProvider serviceProvider,
                                   ISimpleApiClientFactory apiFactory, ITeamExplorerServiceHolder holder,
                                   IConnectionManager cm, IRepositoryHosts hosts, IUIProvider uiProvider, IVisualStudioBrowser vsBrowser,
                                   IUsageTracker usageTracker)
            : base(serviceProvider, apiFactory, holder)
        {
            Guard.ArgumentNotNull(serviceProvider, nameof(serviceProvider));
            Guard.ArgumentNotNull(apiFactory, nameof(apiFactory));
            Guard.ArgumentNotNull(holder, nameof(holder));
            Guard.ArgumentNotNull(cm, nameof(cm));
            Guard.ArgumentNotNull(hosts, nameof(hosts));
            Guard.ArgumentNotNull(uiProvider, nameof(uiProvider));
            Guard.ArgumentNotNull(vsBrowser, nameof(vsBrowser));
            Guard.ArgumentNotNull(usageTracker, nameof(usageTracker));

            this.connectionManager = cm;
            this.hosts             = hosts;
            this.uiProvider        = uiProvider;
            this.usageTracker      = usageTracker;

            CancelCommand = ReactiveCommand.Create();
            Title         = "GitHub";
            Message       = String.Empty;
            browser       = vsBrowser;

            this.WhenAnyValue(x => x.Control.DataContext)
            .Subscribe(x =>
            {
                var pageViewModel = x as IPanePageViewModel;
                var searchable    = x as ISearchablePanePageViewModel;
                controlViewModel  = x as IViewModel;

                Title           = pageViewModel?.Title ?? "GitHub";
                IsSearchEnabled = searchable != null;
                SearchQuery     = searchable?.SearchQuery;
            });
        }
Ejemplo n.º 21
0
        public GitHubConnectSection(IGitHubServiceProvider serviceProvider,
                                    ISimpleApiClientFactory apiFactory,
                                    ITeamExplorerServiceHolder holder,
                                    IConnectionManager manager,
                                    IPackageSettings packageSettings,
                                    ITeamExplorerServices teamExplorerServices,
                                    ILocalRepositories localRepositories,
                                    IUsageTracker usageTracker,
                                    int index)
            : base(serviceProvider, apiFactory, holder, manager)
        {
            Guard.ArgumentNotNull(apiFactory, nameof(apiFactory));
            Guard.ArgumentNotNull(holder, nameof(holder));
            Guard.ArgumentNotNull(manager, nameof(manager));
            Guard.ArgumentNotNull(packageSettings, nameof(packageSettings));
            Guard.ArgumentNotNull(teamExplorerServices, nameof(teamExplorerServices));
            Guard.ArgumentNotNull(localRepositories, nameof(localRepositories));
            Guard.ArgumentNotNull(usageTracker, nameof(usageTracker));

            Title        = "GitHub";
            IsEnabled    = true;
            IsVisible    = false;
            sectionIndex = index;

            this.apiFactory           = apiFactory;
            this.holder               = holder;
            this.packageSettings      = packageSettings;
            this.teamExplorerServices = teamExplorerServices;
            this.localRepositories    = localRepositories;
            this.usageTracker         = usageTracker;

            Clone = ReactiveCommand.CreateFromTask(DoClone);

            ConnectionManager.Connections.CollectionChanged += RefreshConnections;
            PropertyChanged += OnPropertyChange;
            UpdateConnection();
        }
Ejemplo n.º 22
0
        public ForkNavigationItem(IGitHubServiceProvider serviceProvider,
                                  ISimpleApiClientFactory apiFactory,
                                  ITeamExplorerServiceHolder holder,
                                  IDialogService dialogService,
                                  IPackageSettings packageSettings,
                                  IUsageTracker usageTracker)
            : base(serviceProvider, apiFactory, holder, Octicon.repo_forked)
        {
            this.dialogService   = dialogService;
            this.packageSettings = packageSettings;
            this.usageTracker    = usageTracker;

            Text      = Resources.ForkNavigationItemText;
            ArgbColor = Colors.PurpleNavigationItem.ToInt32();
            ConnectionManager.Connections.CollectionChanged += ConnectionsChanged;

            packageSettings.PropertyChanged += (sender, args) =>
            {
                if (args.PropertyName == nameof(packageSettings.ForkButton))
                {
                    IsVisible = packageSettings.ForkButton;
                }
            };
        }
 public EnsureLoggedInSectionSync(ISimpleApiClientFactory apiFactory, ITeamExplorerServiceHolder holder,
                                  IConnectionManager cm, IRepositoryHosts hosts, ITeamExplorerServices teServices)
     : base(apiFactory, holder, cm, hosts, teServices)
 {
 }
 PullRequestCreationViewModel(
      IConnectionRepositoryHostMap connectionRepositoryHostMap, ITeamExplorerServiceHolder teservice,
      IPullRequestService service, INotificationService notifications)
      : this(connectionRepositoryHostMap?.CurrentRepositoryHost, teservice?.ActiveRepo, service,
            notifications)
  {}
 public EnsureLoggedInSectionSync(ISimpleApiClientFactory apiFactory, ITeamExplorerServiceHolder holder,
     IConnectionManager cm, IRepositoryHosts hosts, ITeamExplorerServices teServices)
     : base(apiFactory, holder, cm, hosts, teServices)
 {}
 public TeamExplorerItemBase(ITeamExplorerServiceHolder holder)
 {
     this.holder = holder;
 }
 public TeamExplorerSectionBase(ISimpleApiClientFactory apiFactory, ITeamExplorerServiceHolder holder,
     IConnectionManager cm) : this(apiFactory, holder)
 {
     connectionManager = cm;
 }
 public TeamExplorerSectionBase(IGitHubServiceProvider serviceProvider,
                                ISimpleApiClientFactory apiFactory, ITeamExplorerServiceHolder holder,
                                IConnectionManager cm) : this(serviceProvider, apiFactory, holder)
 {
     connectionManager = cm;
 }
 public TeamExplorerSectionBase(IGitHubServiceProvider serviceProvider,
                                ITeamExplorerServiceHolder holder, IConnectionManager cm) : this(serviceProvider, holder)
 {
     connectionManager = cm;
 }
Ejemplo n.º 30
0
 public TeamExplorerSectionBase(ITeamExplorerServiceHolder holder, IConnectionManager cm) : this(holder)
 {
     connectionManager = cm;
 }
Ejemplo n.º 31
0
 public TeamExplorerItemBase(ISimpleApiClientFactory apiFactory, ITeamExplorerServiceHolder holder)
 {
     this.apiFactory = apiFactory;
     this.holder = holder;
 }
Ejemplo n.º 32
0
 public TeamExplorerItemBase(IGitHubServiceProvider serviceProvider, ITeamExplorerServiceHolder holder)
     : base(serviceProvider)
 {
     this.holder = holder;
 }
 PullRequestListViewModel(
     IConnectionRepositoryHostMap connectionRepositoryHostMap, ITeamExplorerServiceHolder teservice)
     : this(connectionRepositoryHostMap.CurrentRepositoryHost, teservice.ActiveRepo)
 {
 }
 public EnsureLoggedInSectionSync(IGitHubServiceProvider serviceProvider,
                                  ISimpleApiClientFactory apiFactory, ITeamExplorerServiceHolder holder,
                                  IConnectionManager cm, ITeamExplorerServices teServices)
     : base(serviceProvider, apiFactory, holder, cm, teServices)
 {
 }
 public GitHubConnectSection1(ISimpleApiClientFactory apiFactory, ITeamExplorerServiceHolder holder, IConnectionManager manager)
     : base(apiFactory, holder, manager, 1)
 {
 }
 public TeamExplorerItemBase(ITeamExplorerServiceHolder holder)
 {
     this.holder = holder;
 }
Ejemplo n.º 37
0
        public GitHubPaneViewModel(
            IViewViewModelFactory viewModelFactory,
            ISimpleApiClientFactory apiClientFactory,
            IConnectionManager connectionManager,
            ITeamExplorerServiceHolder teServiceHolder,
            IVisualStudioBrowser browser,
            IUsageTracker usageTracker,
            INavigationViewModel navigator,
            ILoggedOutViewModel loggedOut,
            INotAGitHubRepositoryViewModel notAGitHubRepository,
            INotAGitRepositoryViewModel notAGitRepository)
        {
            Guard.ArgumentNotNull(viewModelFactory, nameof(viewModelFactory));
            Guard.ArgumentNotNull(apiClientFactory, nameof(apiClientFactory));
            Guard.ArgumentNotNull(connectionManager, nameof(connectionManager));
            Guard.ArgumentNotNull(teServiceHolder, nameof(teServiceHolder));
            Guard.ArgumentNotNull(browser, nameof(browser));
            Guard.ArgumentNotNull(usageTracker, nameof(usageTracker));
            Guard.ArgumentNotNull(navigator, nameof(navigator));
            Guard.ArgumentNotNull(loggedOut, nameof(loggedOut));
            Guard.ArgumentNotNull(notAGitHubRepository, nameof(notAGitHubRepository));
            Guard.ArgumentNotNull(notAGitRepository, nameof(notAGitRepository));

            this.viewModelFactory     = viewModelFactory;
            this.apiClientFactory     = apiClientFactory;
            this.connectionManager    = connectionManager;
            this.teServiceHolder      = teServiceHolder;
            this.browser              = browser;
            this.usageTracker         = usageTracker;
            this.navigator            = navigator;
            this.loggedOut            = loggedOut;
            this.notAGitHubRepository = notAGitHubRepository;
            this.notAGitRepository    = notAGitRepository;

            var contentAndNavigatorContent = Observable.CombineLatest(
                this.WhenAnyValue(x => x.Content),
                navigator.WhenAnyValue(x => x.Content),
                (c, nc) => new { Content = c, NavigatorContent = nc });

            contentOverride = contentAndNavigatorContent
                              .SelectMany(x =>
            {
                if (x.Content == null)
                {
                    return(Observable.Return(ContentOverride.Spinner));
                }
                else if (x.Content == navigator && x.NavigatorContent != null)
                {
                    return(x.NavigatorContent.WhenAnyValue(
                               y => y.IsLoading,
                               y => y.Error,
                               (l, e) =>
                    {
                        if (l)
                        {
                            return ContentOverride.Spinner;
                        }
                        if (e != null)
                        {
                            return ContentOverride.Error;
                        }
                        else
                        {
                            return ContentOverride.None;
                        }
                    }));
                }
                else
                {
                    return(Observable.Return(ContentOverride.None));
                }
            })
                              .ToProperty(this, x => x.ContentOverride);

            // Returns navigator.Content if Content == navigator, otherwise null.
            var currentPage = contentAndNavigatorContent
                              .Select(x => x.Content == navigator ? x.NavigatorContent : null);

            title = currentPage
                    .SelectMany(x => x?.WhenAnyValue(y => y.Title) ?? Observable.Return <string>(null))
                    .Select(x => x ?? "GitHub")
                    .ToProperty(this, x => x.Title);

            isSearchEnabled = currentPage
                              .Select(x => x is ISearchablePageViewModel)
                              .ToProperty(this, x => x.IsSearchEnabled);

            refresh = ReactiveCommand.CreateAsyncTask(
                currentPage.SelectMany(x => x?.WhenAnyValue(
                                           y => y.IsLoading,
                                           y => y.IsBusy,
                                           (loading, busy) => !loading && !busy)
                                       ?? Observable.Return(false)),
                _ => navigator.Content.Refresh());
            refresh.ThrownExceptions.Subscribe();

            showPullRequests = ReactiveCommand.CreateAsyncTask(
                this.WhenAny(x => x.Content, x => x.Value == navigator),
                _ => ShowPullRequests());

            openInBrowser = ReactiveCommand.Create(currentPage.Select(x => x is IOpenInBrowser));
            openInBrowser.Subscribe(_ =>
            {
                var url = ((IOpenInBrowser)navigator.Content).WebUrl;
                if (url != null)
                {
                    browser.OpenUrl(url);
                }
            });

            navigator.WhenAnyObservable(x => x.Content.NavigationRequested)
            .Subscribe(x => NavigateTo(x).Forget());

            this.WhenAnyValue(x => x.SearchQuery)
            .Where(x => navigator.Content is ISearchablePageViewModel)
            .ObserveOn(RxApp.MainThreadScheduler)
            .Subscribe(x => ((ISearchablePageViewModel)navigator.Content).SearchQuery = x);
        }
Ejemplo n.º 38
0
 public GitHubPaneViewModel(ITeamExplorerServiceHolder holder)
     : base(holder)
 {
     Controls = new ObservableCollection <IView>();
 }
 public TeamExplorerItemBase(ISimpleApiClientFactory apiFactory, ITeamExplorerServiceHolder holder)
 {
     this.apiFactory = apiFactory;
     this.holder     = holder;
 }
 public TeamExplorerSectionBase(ITeamExplorerServiceHolder holder, IConnectionManager cm) : this(holder)
 {
     connectionManager = cm;
 }