Esempio n. 1
0
        public bool TryCreateSolutionContext(out IVsPathContext2 outputPathContext)
        {
            var packagesFolderPath = PackagesFolderPathUtility.GetPackagesFolderPath(_solutionManager.Value, _settings.Value);

            outputPathContext = new VsPathContext(NuGetPathContext.Create(_settings.Value), packagesFolderPath);

            return(outputPathContext != null);
        }
        private async Task <IVsPathContext> TryCreateUserWideContextAsync()
        {
            // It's acceptable to cache these results cause currently:
            // 1. We do not reload configs
            // 2. There is no way to edit gpf/fallback folders through the PM UI.
            var settings = await _userWideSettings.GetValueAsync();

            var outputPathContext = new VsPathContext(NuGetPathContext.Create(settings), _telemetryProvider);

            return(outputPathContext);
        }
Esempio n. 3
0
        public bool TryCreateSolutionContext(string solutionDirectory, out IVsPathContext2 outputPathContext)
        {
            if (solutionDirectory == null)
            {
                throw new ArgumentNullException(nameof(solutionDirectory));
            }

            var packagesFolderPath = PackagesFolderPathUtility.GetPackagesFolderPath(solutionDirectory, _settings.Value);

            outputPathContext = new VsPathContext(NuGetPathContext.Create(_settings.Value), packagesFolderPath);

            return(outputPathContext != null);
        }
Esempio n. 4
0
        private IVsPathContext2 GetSolutionPathContext(string packagesFolderPath)
        {
            VsPathContext pathContext = null;

            // if solution package folder exists, then set it in VSPathContext
            if (!string.IsNullOrEmpty(packagesFolderPath) && Directory.Exists(packagesFolderPath))
            {
                pathContext = new VsPathContext(NuGetPathContext.Create(_settings.Value), packagesFolderPath);
            }
            else
            {
                pathContext = new VsPathContext(NuGetPathContext.Create(_settings.Value));
            }

            return(pathContext);
        }
        public bool TryCreateSolutionContext(out IVsPathContext2 outputPathContext)
        {
            try
            {
                var packagesFolderPath = PackagesFolderPathUtility.GetPackagesFolderPath(_solutionManager.Value, _settings.Value);

                outputPathContext = new VsPathContext(NuGetPathContext.Create(_settings.Value), _telemetryProvider, packagesFolderPath);

                return(outputPathContext != null);
            }
            catch (Exception exception)
            {
                _telemetryProvider.PostFault(exception, typeof(VsPathContextProvider).FullName);
                throw;
            }
        }
        public bool TryCreateSolutionContext(string solutionDirectory, out IVsPathContext2 outputPathContext)
        {
            if (solutionDirectory == null)
            {
                throw new ArgumentNullException(nameof(solutionDirectory));
            }

            try
            {
                var packagesFolderPath = PackagesFolderPathUtility.GetPackagesFolderPath(solutionDirectory, _settings.Value);

                outputPathContext = new VsPathContext(NuGetPathContext.Create(_settings.Value), _telemetryProvider, packagesFolderPath);

                return(outputPathContext != null);
            }
            catch (Exception exception)
            {
                _telemetryProvider.PostFault(exception, typeof(VsPathContextProvider).FullName);
                throw;
            }
        }