public void OpenTemporarySolution(string repositoryPath) //this is Github extension idea to change active repository from TeamExplorer Window. { var dte = _appServiceProvider.GetService <DTE>(); if (dte == null) { throw new Exception("DTE not found"); } if (!_fileService.Exists(repositoryPath)) { throw new Exception($"Repo path doesn't exist: {repositoryPath}"); } try { dte.Solution.Create(repositoryPath, TempSolutionName); dte.Solution.Close(false); } finally { DeleteVsDir(repositoryPath); } }
private Credentials CreateCredentials(string url, string user, SupportedCredentialTypes supportedCredentialTypes) { var userInformationService = _appServiceProvider.GetService <IUserInformationService>(); return(new SecureUsernamePasswordCredentials { Username = userInformationService.ConnectionData.UserName, Password = userInformationService.ConnectionData.Password.ToSecureString(), }); }
/// <summary> /// Initializes a new instance of the <see cref="CommandsPresenter"/> class. /// </summary> /// <param name="servicesProvider"> /// The services Provider. /// </param> /// <param name="window"> /// The window. /// </param> public CommandsPresenter(IAppServiceProvider servicesProvider, ICommandsInfoWindow window) { this.window = window; this.servicesProvider = servicesProvider; this.dispatcher = servicesProvider.GetService <Dispatcher>(); this.commandScopeService = servicesProvider.GetService <ICommandScopeService>(); this.listenerService = servicesProvider.GetService <IKeyboardListenerService>(); this.packageSettings = servicesProvider.GetService <IPackageSettings>(); this.packageSettings.SettingsChanged += this.PackageSettingsOnSettingsChanged; this.PackageSettingsOnSettingsChanged(this, EventArgs.Empty); this.commandInfos = new CommandInfosLoader(this.servicesProvider).LoadCommands(); this.listenerService.KeyDown += this.ListenerServiceOnKeyDown; this.listenerService.KeyUp += this.ListenerServiceOnKeyUp; }
public GitWatcher( IAppServiceProvider appServiceProvider, IEventAggregatorService eventAggregatorService, IGitService gitService ) { _syncContext = SynchronizationContext.Current; this._eventAggregatorService = eventAggregatorService; _gitService = gitService; _gitExt = appServiceProvider.GetService <IGitExt>(); }
/// <summary> /// Initializes a new instance of the <see cref="CommandsInfoWindow"/> class. /// </summary> /// <param name="servicesProvider">The services provider.</param> internal CommandsInfoWindow(IAppServiceProvider servicesProvider) { this.DataContext = new CommandsPresenter(servicesProvider, this); this.InitializeComponent(); this.packageSettings = servicesProvider.GetService <IPackageSettings>(); this.packageSettings.SettingsChanged += (sender, args) => this.UpdateTheme(); this.UpdateTheme(); this.SizeChanged += this.OnSizeChanged; this.IsOpen = false; }
public void Navigate <TView>(object parameter = null) where TView : class, IView { ClearForwardNavigationHistory(); var view = _appServiceProvider.GetService <TView>(); var vm = view.DataContext as IViewModel; vm?.Initialize(parameter); var ev = new NavigationEvent(typeof(TWindow), view) { Parameter = parameter }; _navigationSubject.OnNext(ev); CurrentPageIndex++; _navigationHistory.Add(ev); }
internal CommandsContainer(IAppServiceProvider appServiceProvider, int keyCombinationLevel) { this.keyCombinationLevel = keyCombinationLevel; this.appServiceProvider = appServiceProvider; this.outputWindowService = appServiceProvider.GetService <IOutputWindowService>(); }
public void NavigateToHomePage() { _appServiceProvider.GetService <ITeamExplorer>()?.NavigateToPage(new Guid(TeamExplorerPageIds.Home), null); }