Ejemplo n.º 1
0
        protected override IEnumerable <ExecutionTarget> OnGetExecutionTargets(OperationContext ctx, ConfigurationSelector configuration, SolutionItemRunConfiguration runConfig)
        {
            var result = new ExecutionTargetGroup(GettextCatalog.GetString("Browser"), "MonoDevelop.AspNetCore.BrowserExecutionTargets");

            foreach (var browser in IdeServices.DesktopService.GetApplications("https://localhost", Ide.Desktop.DesktopApplicationRole.Viewer))
            {
                if (browser.IsDefault)
                {
                    if (Project.HasMultipleTargetFrameworks)
                    {
                        result.InsertRange(0, GetMultipleTargetFrameworkExecutionTargets(browser));
                    }
                    else
                    {
                        result.Insert(0, new AspNetCoreExecutionTarget(browser));
                    }
                }
                else
                {
                    if (Project.HasMultipleTargetFrameworks)
                    {
                        result.AddRange(GetMultipleTargetFrameworkExecutionTargets(browser));
                    }
                    else
                    {
                        result.Add(new AspNetCoreExecutionTarget(browser));
                    }
                }
            }

            return(result.Count > 0
                                ? new ExecutionTarget [] { result }
                                : base.OnGetExecutionTargets(ctx, configuration, runConfig));
        }
        protected override IEnumerable <ExecutionTarget> OnGetExecutionTargets(ConfigurationSelector configuration)
        {
            var result = new ExecutionTargetGroup(GettextCatalog.GetString("Browser"), "MonoDevelop.AspNet.BrowserExecutionTargets");

            foreach (var browser in MonoDevelop.Ide.IdeServices.DesktopService.GetApplications("https://localhost", DesktopApplicationRole.Viewer))
            {
                if (browser.IsDefault)
                {
                    result.Insert(0, new BrowserExecutionTarget(browser.Id, browser.DisplayName, browser));
                }
                else
                {
                    result.Add(new BrowserExecutionTarget(browser.Id, browser.DisplayName, browser));
                }
            }
            yield return(result);
        }