public VsFileDiffProvider( IVsDifferenceService vsDifferenceService, string solutionPath, SolutionSelectionContainer <ISolutionSelection> selectionContainer, ErrorPresenter errorPresenter, GitFileDiffController gitFileDiffController) { this.vsDifferenceService = vsDifferenceService; this.solutionPath = solutionPath; this.errorPresenter = errorPresenter; this.gitFileDiffController = gitFileDiffController; this.DocumentPath = selectionContainer.FullName; this.OldDocumentPath = selectionContainer.OldFullName; }
protected async Task InitializeAsync(IGitBranchDifferPackage package) { await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); this.package = package ?? throw new ArgumentNullException(nameof(package)); this.dte = await package.GetServiceAsync(typeof(EnvDTE.DTE)) as EnvDTE.DTE ?? throw new ArgumentNullException(nameof(dte)); this.vsUIShell = await package.GetServiceAsync(typeof(SVsUIShell)) as IVsUIShell ?? throw new ArgumentNullException(nameof(vsUIShell)); // Dependencies that can be moved to constructor and resolved via IoC... this.vsDifferenceService = await package.GetServiceAsync(typeof(SVsDifferenceService)) as IVsDifferenceService ?? throw new ArgumentNullException(nameof(vsDifferenceService)); this.commandService = await package.GetServiceAsync(typeof(IMenuCommandService)) as IMenuCommandService ?? throw new ArgumentNullException(nameof(commandService)); this.errorPresenter = VsDIContainer.Instance.GetService(typeof(ErrorPresenter)) as ErrorPresenter ?? throw new ArgumentNullException(nameof(errorPresenter)); this.gitFileDiffController = DIContainer.Instance.GetService(typeof(GitFileDiffController)) as GitFileDiffController ?? throw new ArgumentNullException(nameof(gitFileDiffController)); }