public WindowModel(UnconfiguredProject project, IEnumerable<IDeployTargetUI> targetUIs, IProjectLockService lockService, IThreadHandling threadHandling)
 {
     this.project = project;
     this.threadHandling = threadHandling;
     this.lockService = lockService;
     TargetUIs = targetUIs;
 }
 public GitHubDeploy(IUserSettings settings, UnconfiguredProject project, IProjectLockService projectLockService, IThreadHandling threadHandler)
 {
     this.project = project;
     this.projectLockService = projectLockService;
     this.threadHandler = threadHandler;
     this.settings = settings;
 }
Beispiel #3
0
        public RProjectLoadHooks(UnconfiguredProject unconfiguredProject
            , [ImportMany("Microsoft.VisualStudio.ProjectSystem.Microsoft.VisualStudio.Shell.Interop.IVsProject")] IEnumerable<Lazy<IVsProject>> cpsIVsProjects
            , IProjectLockService projectLockService
            , IRInteractiveWorkflowProvider workflowProvider
            , IInteractiveWindowComponentContainerFactory componentContainerFactory
            , IRToolsSettings toolsSettings
            , IThreadHandling threadHandling
            , ISurveyNewsService surveyNews
            , [Import(AllowDefault = true)] IProjectItemDependencyProvider dependencyProvider
            , ICoreShell coreShell) {

            _unconfiguredProject = unconfiguredProject;
            _cpsIVsProjects = cpsIVsProjects;
            _projectLockService = projectLockService;
            _workflowProvider = workflowProvider;

            _toolsSettings = toolsSettings;
            _threadHandling = threadHandling;
            _surveyNews = surveyNews;
            _dependencyProvider = dependencyProvider;
            _coreShell = coreShell;

            _projectDirectory = unconfiguredProject.GetProjectDirectory();

            unconfiguredProject.ProjectRenamedOnWriter += ProjectRenamedOnWriter;
            unconfiguredProject.ProjectUnloading += ProjectUnloading;
            _fileWatcher = new MsBuildFileSystemWatcher(_projectDirectory, "*", 25, 1000, _coreShell.Services.FileSystem, new RMsBuildFileSystemFilter(), coreShell.Services.Log);
            _fileWatcher.Error += FileWatcherError;
            Project = new FileSystemMirroringProject(unconfiguredProject, projectLockService, _fileWatcher, _dependencyProvider, coreShell.Services.Log);
        }
 public static string GetSelectedFolderPath(this IImmutableSet<IProjectTree> nodes, UnconfiguredProject unconfiguredProject) {
     if (nodes.Count == 1) {
         var n = nodes.First();
         if (n.IsRoot()) {
             return Path.GetDirectoryName(unconfiguredProject.FullPath);
         }
         return nodes.GetNodeFolderPath();
     }
     return string.Empty;
 }
Beispiel #5
0
        public async Task SetProjectAsync(UnconfiguredProject project, IRProjectProperties properties) {
            if(_access != null) {
                throw new InvalidOperationException("Project is already set");
            }
            _access = await _settingsProvider.OpenProjectSettingsAccessAsync(project, properties);
            _viewModel = new SettingsPageViewModel(_access.Settings, _appShell, _fs);
            await _viewModel.SetProjectPathAsync(Path.GetDirectoryName(project.FullPath), properties);

            PopulateFilesCombo();
            LoadPropertyGrid();

            _access.Settings.CollectionChanged += OnSettingsCollectionChanged;
        }
        private CommandGroupHandler(UnconfiguredProject project, IThreadHandling threadHandler, IProjectLockService lockService, 
            [ImportMany] IEnumerable<IDeployTargetUI> targetUIs, [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider)
        {
            this.threadHandler = threadHandler;
            threadHandler.VerifyOnUIThread();
            this.project = project;
            uiShell = (IVsUIShell)serviceProvider.GetService(typeof(IVsUIShell));
            docTable = (IVsRunningDocumentTable)serviceProvider.GetService(typeof(IVsRunningDocumentTable));

            ProjectHierarchies = new OrderPrecedenceImportCollection<IVsHierarchy>(projectCapabilityCheckProvider: project);
            this.lockService = lockService;
            this.targetUIs = targetUIs;
        }
Beispiel #7
0
        public RProjectLoadHooks(UnconfiguredProject unconfiguredProject, IProjectLockService projectLockService, IRInteractiveWorkflowProvider workflowProvider, IInteractiveWindowComponentContainerFactory componentContainerFactory, IRToolsSettings toolsSettings, IFileSystem fileSystem, IThreadHandling threadHandling) {
            _unconfiguredProject = unconfiguredProject;
            _workflowProvider = workflowProvider;
            _componentContainerFactory = componentContainerFactory;

            _toolsSettings = toolsSettings;
            _fileSystem = fileSystem;
            _threadHandling = threadHandling;
            _projectDirectory = unconfiguredProject.GetProjectDirectory();

            unconfiguredProject.ProjectUnloading += ProjectUnloading;
            _fileWatcher = new MsBuildFileSystemWatcher(_projectDirectory, "*", 25, fileSystem, new RMsBuildFileSystemFilter());
            Project = new FileSystemMirroringProject(unconfiguredProject, projectLockService, _fileWatcher);
        }
        public FileSystemMirroringProject(UnconfiguredProject unconfiguredProject, IProjectLockService projectLockService, MsBuildFileSystemWatcher fileSystemWatcher, IActionLog log = null) {
            _unconfiguredProject = unconfiguredProject;
            _projectLockService = projectLockService;
            _fileSystemWatcher = fileSystemWatcher;
            _log = log ?? ProjectSystemActionLog.Default;
            _unloadCancellationToken = _unconfiguredProject.Services.ProjectAsynchronousTasks.UnloadCancellationToken;
            _projectDirectory = _unconfiguredProject.GetProjectDirectory();
            _inMemoryImportFullPath = _unconfiguredProject.GetInMemoryTargetsFileFullPath();
            _fileItems = new Dictionary<string, ProjectItemElement>(StringComparer.OrdinalIgnoreCase);
            _directoryItems = new Dictionary<string, ProjectItemElement>(StringComparer.OrdinalIgnoreCase);

            var changesHandler = new Func<MsBuildFileSystemWatcher.Changeset, Task>(FileSystemChanged);
            _fileSystemWatcher.SourceBlock.LinkTo(new ActionBlock<MsBuildFileSystemWatcher.Changeset>(changesHandler));
        }
        public ProjectSettingsControlTest(PackageTestFilesFixture files) {
            _files = files;
            _appShell = Substitute.For<IApplicationShell>();
            _fs = Substitute.For<IFileSystem>();

            _access = Substitute.For<IProjectConfigurationSettingsAccess>();
            _access.Settings.Returns(_coll);

            _csp = Substitute.For<IProjectConfigurationSettingsProvider>();
            _csp.OpenProjectSettingsAccessAsync(null, null).ReturnsForAnyArgs(Task.FromResult(_access));

            _unconfiguredProject = Substitute.For<UnconfiguredProject>();
            _unconfiguredProject.FullPath.Returns(@"C:\file.rproj");

            _properties = Substitute.For<IRProjectProperties>();
            _properties.GetSettingsFileAsync().Returns(Task.FromResult<string>(null));
        }
        private static ActiveConfiguredProjectsLoader CreateInstance(UnconfiguredProject project, IActiveConfigurationGroupService activeConfigurationGroupService, IUnconfiguredProjectTasksService tasksService)
        {
            tasksService = tasksService ?? IUnconfiguredProjectTasksServiceFactory.ImplementLoadedProjectAsync <ConfiguredProject>(t => t());

            return(new ActiveConfiguredProjectsLoader(project, activeConfigurationGroupService, tasksService));
        }
 public AssemblyOriginatorKeyFileValueProvider(UnconfiguredProject project)
 {
     _unconfiguredProject = project;
 }
 private static ProjectCapabilitiesMissingVetoProjectLoad CreateInstance(UnconfiguredProject project, IProjectCapabilitiesService projectCapabilitiesService)
 {
     return(new ProjectCapabilitiesMissingVetoProjectLoad(project, projectCapabilitiesService));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ProjectProperties"/> class.
 /// </summary>
 public ProjectProperties(ConfiguredProject configuredProject, UnconfiguredProject unconfiguredProject)
     : base(configuredProject, unconfiguredProject)
 {
 }
 public PackageRestoreConfiguredInputDataSource(ConfiguredProject project, IProjectSubscriptionService projectSubscriptionService)
     : base(project.Services, synchronousDisposal: true, registerDataSource: false)
 {
     _containingProject          = project.UnconfiguredProject;
     _projectSubscriptionService = projectSubscriptionService;
 }
 public SetDirectoryHereCommand(UnconfiguredProject unconfiguredProject, IRInteractiveWorkflowProvider interactiveWorkflowProvider) {
     _unconfiguredProject = unconfiguredProject;
     _interactiveWorkflowProvider = interactiveWorkflowProvider;
 }
 public OpenContainingFolderCommand(UnconfiguredProject unconfiguredProject, [Import(AllowDefault = true)] IProcessServices ps) {
     _unconfiguredProject = unconfiguredProject;
     _ps = ps ?? new ProcessServices();
 }
Beispiel #17
0
 public static string GetSelectedFolderPath(this IImmutableSet <IProjectTree> nodes, UnconfiguredProject unconfiguredProject)
 {
     if (nodes.Count == 1)
     {
         var n = nodes.First();
         if (n.IsRoot())
         {
             return(Path.GetDirectoryName(unconfiguredProject.FullPath));
         }
         return(nodes.GetNodeFolderPath());
     }
     return(string.Empty);
 }
        public ActiveConfiguredProjectsProvider(IUnconfiguredProjectServices services, UnconfiguredProject project)
        {
            Requires.NotNull(services, nameof(services));
            Requires.NotNull(project, nameof(project));

            _services = services;
            _project  = project;

            DimensionProviders = new OrderPrecedenceImportCollection <IActiveConfiguredProjectsDimensionProvider>(projectCapabilityCheckProvider: project);
        }
Beispiel #19
0
 public DynamicItemHandler(UnconfiguredProject project)
 {
     _project = project;
 }
Beispiel #20
0
 public LaunchProfileProjectItemProvider(UnconfiguredProject project, ILaunchSettingsProvider launchSettingsProvider)
 {
     _project = project;
     _launchSettingsProvider = launchSettingsProvider;
 }
Beispiel #21
0
 public AdditionalFilesItemHandler(UnconfiguredProject project)
 {
     _project = project;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ProjectProperties"/> class.
 /// </summary>
 public NuProjProjectProperties(ConfiguredProject configuredProject, UnconfiguredProject unconfiguredProject)
     : base(configuredProject, unconfiguredProject)
 {
 }
 public OpenRDataVsStd97CommandGroupHandler(UnconfiguredProject unconfiguredProject, IRInteractiveWorkflowProvider workflowProvider)
     : base(unconfiguredProject, workflowProvider, (long)VSConstants.VSStd97CmdID.Open) {}
Beispiel #24
0
 public PropertyPageProvider(UnconfiguredProject unconfiguredProject) {
     PropertyPages = new OrderPrecedenceImportCollection<IPageMetadata>(projectCapabilityCheckProvider: unconfiguredProject);
 }
 public BrowseToDependencyInExplorerCommand(UnconfiguredProject project, IFileExplorer fileExplorer)
     : base(project)
 {
     _fileExplorer = fileExplorer;
 }
 public OpenRDataCommandGroupHandler(UnconfiguredProject unconfiguredProject, IRInteractiveWorkflowProvider workflowProvider, params long[] commandIds) {
     _unconfiguredProject = unconfiguredProject;
     _workflowProvider = workflowProvider;
     _commandIds = commandIds;
 }
Beispiel #27
0
 public AddRMarkdownCommand(UnconfiguredProject unconfiguredProject, IProjectSystemServices pss): 
     base(unconfiguredProject, pss, RPackageCommandId.icmdAddRMarkdown, "emptyrmd", "markdown", "rmd") {
 }
Beispiel #28
0
 public OpenRDataCommandGroupHandler(UnconfiguredProject unconfiguredProject, IRInteractiveWorkflowProvider workflowProvider, params long[] commandIds)
 {
     _unconfiguredProject = unconfiguredProject;
     _workflowProvider    = workflowProvider;
     _commandIds          = commandIds;
 }
 public OpenRDataVsStd97CommandGroupHandler(UnconfiguredProject unconfiguredProject, IRSessionProvider sessionProvider)
     : base(unconfiguredProject, sessionProvider, (long)VSConstants.VSStd97CmdID.Open) {}
 internal DebugPageViewModel(TaskCompletionSource snapshotComplete, UnconfiguredProject project)
 {
     _firstSnapshotCompleteSource = snapshotComplete;
     Project          = project;
     PropertyChanged += ViewModel_PropertyChanged;
 }
 public PackageReadmeFileValueProvider(
     [Import(ExportContractNames.ProjectItemProviders.SourceFiles)] IProjectItemProvider sourceItemsProvider,
     UnconfiguredProject unconfiguredProject) :
     base(PackageReadmeFilePropertyName, sourceItemsProvider, unconfiguredProject)
 {
 }
        public AnalyzerItemHandler(UnconfiguredProject project)
        {
            Requires.NotNull(project, nameof(project));

            _project = project;
        }
Beispiel #33
0
 public StartupObjectsEnumProvider([Import(typeof(VisualStudioWorkspace))] Workspace workspace, UnconfiguredProject project)
 {
     _workspace           = workspace;
     _unconfiguredProject = project;
 }
        protected override async Task <ImmutableArray <string> > GetOrderedPropertyValuesAsync(UnconfiguredProject project)
        {
            Requires.NotNull(project, nameof(project));

            string targetFrameworksProperty = await GetPropertyValue(project, ConfigurationGeneral.TargetFrameworksProperty).ConfigureAwait(true);

            if (targetFrameworksProperty != null)
            {
                return(BuildUtilities.GetPropertyValues(targetFrameworksProperty));
            }
            else
            {
                // If the project doesn't have a "TargetFrameworks" property, then this is not a cross-targeting project and we don't need a target framework dimension.
                return(ImmutableArray <string> .Empty);
            }
        }
Beispiel #35
0
 public StartupObjectsEnumGenerator(Workspace workspace, UnconfiguredProject project, bool includeEmptyValue)
 {
     _workspace           = workspace;
     _unconfiguredProject = project;
     _includeEmptyValue   = includeEmptyValue;
 }
Beispiel #36
0
 public static void ReportProjectVersion(this IQueryExecutionContext queryExecutionContext, UnconfiguredProject unconfiguredProject)
 {
     unconfiguredProject.GetQueryDataVersion(out string versionKey, out long versionNumber);
     queryExecutionContext.ReportInputDataVersion(versionKey, versionNumber);
 }
 internal AvoidPersistingProjectGuidStorageProvider(IProjectAccessor projectAccessor, UnconfiguredProject project)
 {
     _projectAccessor = projectAccessor;
     _project         = project;
 }
 internal abstract AbstractGenerateNuGetPackageCommand CreateInstanceCore(
     UnconfiguredProject project,
     IProjectThreadingService threadingService,
     IVsService <SVsSolutionBuildManager, IVsSolutionBuildManager2> vsSolutionBuildManagerService,
     GeneratePackageOnBuildPropertyProvider generatePackageOnBuildPropertyProvider);
        public async Task <IEnumerable <KeyValuePair <string, string> > > GetDefaultValuesForDimensionsAsync(UnconfiguredProject project)
        {
            // First target framework is the default one.
            var targetFrameworks = await GetOrderedTargetFrameworksAsync(project).ConfigureAwait(false);

            if (targetFrameworks.IsEmpty)
            {
                return(ImmutableArray <KeyValuePair <string, string> > .Empty);
            }

            return(ImmutableArray.Create(new KeyValuePair <string, string>(TargetFrameworkPropertyName, targetFrameworks.First())));
        }
Beispiel #40
0
        public MetadataReferenceItemHandler(UnconfiguredProject project)
        {
            Requires.NotNull(project, nameof(project));

            _unconfiguredProject = project;
        }
 protected FileSystemMirroringProjectSourceItemProviderExtensionBase(UnconfiguredProject unconfiguredProject, ConfiguredProject configuredProject, IProjectLockService projectLockService, IFileSystemMirroringProjectTemporaryItems temporaryItems) {
     _unconfiguredProject = unconfiguredProject;
     _configuredProject = configuredProject;
     _projectLockService = projectLockService;
     _temporaryItems = temporaryItems;
 }
 private static ActiveConfiguredProjectsLoader CreateInstance(UnconfiguredProject project, out ProjectValueDataSource <IConfigurationGroup <ProjectConfiguration> > source)
 {
     return(CreateInstance(project, null, out source));
 }
 public MyUnconfiguredProject(UnconfiguredProject unconfiguredProject)
 {
     this.ProjectHierarchies = new OrderPrecedenceImportCollection<IVsHierarchy>(projectCapabilityCheckProvider: unconfiguredProject);
 }
        private async Task<IVsWindowFrame> CreateDocWindowAsync(UnconfiguredProject unconfiguredProject, string documentName, IVsHierarchy hierarchy, uint itemId)
        {
            var windowFlags = _VSRDTFLAGS.RDT_DontAddToMRU | _VSRDTFLAGS.RDT_DontAutoOpen;
            var model = new WindowModel(project, targetUIs, lockService, threadHandler);
            await model.LoadFromProject();
            var control = new Control(model);
            var windowPane = new WindowPane(control);
            var editorType = Guid.Empty;
            var commandUI = Guid.Empty;
            var caption = $"{model.Name} Deploy Rules";
            IVsWindowFrame frame;
            var docView = IntPtr.Zero;
            var docData = IntPtr.Zero;
            var hr = 0;

            try
            {
                docView = Marshal.GetIUnknownForObject(windowPane);
                docData = Marshal.GetIUnknownForObject(model);
                hr = uiShell.CreateDocumentWindow((uint)windowFlags, documentName, (IVsUIHierarchy)hierarchy, itemId,
                    docView, docData, ref editorType, null, ref commandUI, null, caption, string.Empty, null, out frame);
            }
            finally
            {
                if (docView != IntPtr.Zero)
                {
                    Marshal.Release(docView);
                }
                if (docData != IntPtr.Zero)
                {
                    Marshal.Release(docData);
                }
            }
            ErrorHandler.ThrowOnFailure(hr);
            return frame;
        }
 public System.Threading.Tasks.Task UnloadProjectAsync(UnconfiguredProject project) {
     throw new NotImplementedException();
 }
        public async Task <IEnumerable <KeyValuePair <string, IEnumerable <string> > > > GetProjectConfigurationDimensionsAsync(UnconfiguredProject project)
        {
            var targetFrameworks = await GetOrderedTargetFrameworksAsync(project).ConfigureAwait(false);

            if (targetFrameworks.IsEmpty)
            {
                return(ImmutableArray <KeyValuePair <string, IEnumerable <string> > > .Empty);
            }

            return(ImmutableArray.Create(new KeyValuePair <string, IEnumerable <string> >(TargetFrameworkPropertyName, targetFrameworks)));
        }
 public OpenRDataCommandGroupHandler(UnconfiguredProject unconfiguredProject, IRSessionProvider sessionProvider, params long[] commandIds) {
     _unconfiguredProject = unconfiguredProject;
     _session = sessionProvider.GetInteractiveWindowRSession();
     _commandIds = commandIds;
 }
 public RProjectCapabilityProvider(UnconfiguredProject unconfiguredProject)
     : base(ProjectConstants.RtvsRulesPropsRelativePath, unconfiguredProject, 
            ProjectConstants.RtvsRulesPropsRelativePath, ProjectConstants.RtvsProjectCapability) { }
        private async Task <ImmutableArray <string> > GetOrderedTargetFrameworksAsync(UnconfiguredProject project)
        {
            Requires.NotNull(project, nameof(project));

            using (var access = await _projectLockService.ReadLockAsync())
            {
                var projectRoot = await access.GetProjectXmlAsync(project.FullPath).ConfigureAwait(false);

                // If the project already defines a specific "TargetFramework" to target, then this is not a cross-targeting project and we don't need a target framework dimension.
                var targetFrameworkProperty = GetProperty(projectRoot, TargetFrameworkPropertyName);
                if (!string.IsNullOrEmpty(targetFrameworkProperty))
                {
                    return(ImmutableArray <string> .Empty);
                }

                // Read the "TargetFrameworks" property from the project file.
                // TODO: https://github.com/dotnet/roslyn-project-system/issues/547
                //       We should read the "TargetFrameworks" properties from msbuild project evaluation at unconfigured project level, but there doesn't seem to be a way to do so.
                var targetFrameworksProperty = GetProperty(projectRoot, ConfigurationGeneral.TargetFrameworksProperty);
                if (string.IsNullOrEmpty(targetFrameworksProperty))
                {
                    return(ImmutableArray <string> .Empty);
                }

                return(ParseTargetFrameworks(targetFrameworksProperty));
            }
        }
 public OpenRDataVsUiHierarchyWindowCommandGroupHandler(UnconfiguredProject unconfiguredProject, IRInteractiveWorkflowProvider workflowProvider)
     : base(unconfiguredProject, workflowProvider, (long)VSConstants.VsUIHierarchyWindowCmdIds.UIHWCMDID_DoubleClick, (long)VSConstants.VsUIHierarchyWindowCmdIds.UIHWCMDID_EnterKey) {}
 public OpenRDataCommandGroupHandler(UnconfiguredProject unconfiguredProject, IRSessionProvider sessionProvider, params long[] commandIds)
 {
     _unconfiguredProject = unconfiguredProject;
     _session             = sessionProvider.GetInteractiveWindowRSession();
     _commandIds          = commandIds;
 }
 public RProjectSourceItemProviderExtension(UnconfiguredProject unconfiguredProject, ConfiguredProject configuredProject, IProjectLockService projectLockService, IFileSystemMirroringProjectTemporaryItems temporaryItems)
     : base(unconfiguredProject, configuredProject, projectLockService, temporaryItems) {
 }
Beispiel #53
0
 public DependencyTextPackager(UnconfiguredProject project)
 {
     _project = project;
 }
Beispiel #54
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RuleProperties"/> class.
 /// </summary>
 public RuleProperties(ConfiguredProject configuredProject, UnconfiguredProject unconfiguredProject)
     : base(configuredProject, unconfiguredProject)
 {
 }
Beispiel #55
0
 public ActiveEditorContextTracker(UnconfiguredProject project) // For scoping
 {
 }
 public MyUnconfiguredProject(UnconfiguredProject unconfiguredProject)
 {
     this.ProjectHierarchies = new OrderPrecedenceImportCollection <IVsHierarchy>(projectCapabilityCheckProvider: unconfiguredProject);
 }
Beispiel #57
0
 public AddRScriptCommand(UnconfiguredProject unconfiguredProject, IProjectSystemServices pss) :
     base(unconfiguredProject, pss, RPackageCommandId.icmdAddRScript, "rscript", "script", "R") {
 }