static OpenFromClipboardCommand CreateOpenFromClipboardCommand( IGitHubContextService gitHubContextService = null, ITeamExplorerContext teamExplorerContext = null, IVSServices vsServices = null, GitHubContext contextFromClipboard = null, string repositoryDir = null, string repositoryName = null, string repositoryOwner = null, string currentBranch = null, (string, string, string)?resolveBlobResult = null,
public DialogService( IViewViewModelFactory factory, IShowDialogService showDialog, IGitHubContextService gitHubContextService) { Guard.ArgumentNotNull(factory, nameof(factory)); Guard.ArgumentNotNull(showDialog, nameof(showDialog)); Guard.ArgumentNotNull(showDialog, nameof(gitHubContextService)); this.factory = factory; this.showDialog = showDialog; this.gitHubContextService = gitHubContextService; }
static OpenFromUrlCommand CreateOpenFromUrlCommand( IDialogService dialogService = null, IRepositoryCloneService repositoryCloneService = null, ITeamExplorerContext teamExplorerContext = null, IGitHubContextService gitHubContextService = null) { dialogService = dialogService ?? Substitute.For <IDialogService>(); repositoryCloneService = repositoryCloneService ?? Substitute.For <IRepositoryCloneService>(); teamExplorerContext = teamExplorerContext ?? Substitute.For <ITeamExplorerContext>(); gitHubContextService = gitHubContextService ?? Substitute.For <IGitHubContextService>(); return(new OpenFromUrlCommand( new Lazy <IDialogService>(() => dialogService), new Lazy <IRepositoryCloneService>(() => repositoryCloneService), new Lazy <ITeamExplorerContext>(() => teamExplorerContext), new Lazy <IGitHubContextService>(() => gitHubContextService))); }
public RepositoryCloneService( IOperatingSystem operatingSystem, IVSGitServices vsGitServices, ITeamExplorerServices teamExplorerServices, IGraphQLClientFactory graphqlFactory, IGitHubContextService gitHubContextService, IUsageTracker usageTracker, IGitHubServiceProvider sp) { this.operatingSystem = operatingSystem; this.vsGitServices = vsGitServices; this.teamExplorerServices = teamExplorerServices; this.graphqlFactory = graphqlFactory; this.gitHubContextService = gitHubContextService; this.usageTracker = usageTracker; dte = new Lazy <EnvDTE.DTE>(() => sp.GetService <EnvDTE.DTE>()); defaultClonePath = GetLocalClonePathFromGitProvider(operatingSystem.Environment.GetUserRepositoriesPath()); }
public RepositorySelectViewModel(IRepositoryCloneService service, IGitHubContextService gitHubContextService) { Guard.ArgumentNotNull(service, nameof(service)); Guard.ArgumentNotNull(service, nameof(gitHubContextService)); this.service = service; this.gitHubContextService = gitHubContextService; var selectedRepository = this.WhenAnyValue(x => x.SelectedItem) .Select(CreateRepository); var filterRepository = this.WhenAnyValue(x => x.Filter) .Select(f => gitHubContextService.FindContextFromUrl(f)) .Select(CreateRepository); repository = selectedRepository .Merge(filterRepository) .ToProperty(this, x => x.Repository); this.WhenAnyValue(x => x.Filter).Subscribe(_ => ItemsView?.Refresh()); }