Exemplo n.º 1
0
        public Task <IReadOnlyCollection <IPageMetadata> > GetPagesAsync()
        {
            ImmutableArray <IPageMetadata> .Builder builder = ImmutableArray.CreateBuilder <IPageMetadata>();
            builder.Add(VisualBasicProjectDesignerPage.Application);
            builder.Add(VisualBasicProjectDesignerPage.Compile);

            if (_capabilities.Contains(ProjectCapability.Pack))
            {
                builder.Add(VisualBasicProjectDesignerPage.Package);
            }

            builder.Add(VisualBasicProjectDesignerPage.References);

            if (_capabilities.Contains(ProjectCapability.LaunchProfiles))
            {
                builder.Add(VisualBasicProjectDesignerPage.Debug);
            }

            return(Task.FromResult <IReadOnlyCollection <IPageMetadata> >(builder.ToImmutable()));
        }
        public Task <IReadOnlyCollection <IPageMetadata> > GetPagesAsync()
        {
            var builder = PooledArray <IPageMetadata> .GetInstance();

            builder.Add(FSharpProjectDesignerPage.Application);
            builder.Add(FSharpProjectDesignerPage.Build);
            builder.Add(FSharpProjectDesignerPage.BuildEvents);

            if (_capabilities.Contains(ProjectCapability.LaunchProfiles))
            {
                builder.Add(FSharpProjectDesignerPage.Debug);
            }

            if (_capabilities.Contains(ProjectCapability.Pack))
            {
                builder.Add(FSharpProjectDesignerPage.Package);
            }

            builder.Add(FSharpProjectDesignerPage.ReferencePaths);

            return(Task.FromResult <IReadOnlyCollection <IPageMetadata> >(builder.ToImmutableAndFree()));
        }
Exemplo n.º 3
0
        public Task <IReadOnlyCollection <IPageMetadata> > GetPagesAsync()
        {
            ImmutableArray <IPageMetadata> .Builder builder = ImmutableArray.CreateBuilder <IPageMetadata>();

            builder.Add(CSharpProjectDesignerPage.Application);
            builder.Add(CSharpProjectDesignerPage.Build);
            builder.Add(CSharpProjectDesignerPage.BuildEvents);

            if (_capabilities.Contains(ProjectCapability.Pack))
            {
                builder.Add(CSharpProjectDesignerPage.Package);
            }

            if (_capabilities.Contains(ProjectCapability.LaunchProfiles))
            {
                builder.Add(CSharpProjectDesignerPage.Debug);
            }

            builder.Add(CSharpProjectDesignerPage.Signing);

            return(Task.FromResult <IReadOnlyCollection <IPageMetadata> >(builder.ToImmutable()));
        }
        public Task <IReadOnlyCollection <IPageMetadata> > GetPagesAsync()
        {
            var builder = PooledArray <IPageMetadata> .GetInstance(capacity : 7);

            builder.Add(VisualBasicProjectDesignerPage.Application);
            builder.Add(VisualBasicProjectDesignerPage.Compile);

            if (_capabilities.Contains(ProjectCapability.Pack))
            {
                builder.Add(VisualBasicProjectDesignerPage.Package);
            }

            builder.Add(VisualBasicProjectDesignerPage.References);

            if (_capabilities.Contains(ProjectCapability.LaunchProfiles))
            {
                builder.Add(VisualBasicProjectDesignerPage.Debug);
            }

            builder.Add(VisualBasicProjectDesignerPage.Signing);
            builder.Add(VisualBasicProjectDesignerPage.CodeAnalysis);

            return(Task.FromResult <IReadOnlyCollection <IPageMetadata> >(builder.ToImmutableAndFree()));
        }
        public Task <bool> AllowProjectLoadAsync(bool isNewProject, ProjectConfiguration activeConfiguration, CancellationToken cancellationToken = default)
        {
            ProjectType?projectType = GetCurrentProjectType();

            if (projectType == null)    // Unrecognized, probably a Shared Project
            {
                return(TaskResult.True);
            }

            foreach (string capability in projectType.Capabilities)
            {
                if (!_projectCapabilitiesService.Contains(capability))
                {
                    // Throw instead of returning false so that we can control message and the HRESULT
                    throw new COMException(string.Format(CultureInfo.CurrentCulture, Resources.ProjectLoadedWithWrongProjectType, _project.FullPath),
                                           HResult.Fail);
                }
            }

            return(TaskResult.True);
        }
 private bool ShouldHandle(IProjectTree node) => node.IsRoot() && _projectCapabiltiesService.Contains("OpenProjectFile");