From 7db13960e9c665ea69b9f177bc6f7a8314e0b330 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Mon, 8 Oct 2018 13:32:12 +0100 Subject: [PATCH] Adds in GetAllTypes to ApplicationTreeService --- src/Umbraco.Core/Services/IApplicationTreeService.cs | 11 ++++++++++- src/Umbraco.Web/Services/ApplicationTreeService.cs | 6 ++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Core/Services/IApplicationTreeService.cs b/src/Umbraco.Core/Services/IApplicationTreeService.cs index 5b6976c021..98c3047fea 100644 --- a/src/Umbraco.Core/Services/IApplicationTreeService.cs +++ b/src/Umbraco.Core/Services/IApplicationTreeService.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using Umbraco.Core.Models; namespace Umbraco.Core.Services @@ -41,6 +42,9 @@ namespace Umbraco.Core.Services /// Returns a ApplicationTree Array IEnumerable GetAll(); + + IEnumerable GetAllTypes(); + /// /// Gets the application tree for the applcation with the specified alias /// @@ -113,6 +117,11 @@ namespace Umbraco.Core.Services throw new System.NotImplementedException(); } + public IEnumerable GetAllTypes() + { + throw new System.NotImplementedException(); + } + /// /// Gets the application tree for the applcation with the specified alias /// diff --git a/src/Umbraco.Web/Services/ApplicationTreeService.cs b/src/Umbraco.Web/Services/ApplicationTreeService.cs index abd9f08a53..08a17187e7 100644 --- a/src/Umbraco.Web/Services/ApplicationTreeService.cs +++ b/src/Umbraco.Web/Services/ApplicationTreeService.cs @@ -21,6 +21,7 @@ namespace Umbraco.Web.Services private readonly ILogger _logger; private readonly CacheHelper _cache; private Lazy> _allAvailableTrees; + private IEnumerable _treeTypes; internal const string TreeConfigFileName = "trees.config"; private static string _treeConfig; private static readonly object Locker = new object(); @@ -251,6 +252,11 @@ namespace Umbraco.Web.Services return GetAppTrees().OrderBy(x => x.SortOrder); } + public IEnumerable GetAllTypes() + { + return _treeTypes ?? (_treeTypes = GetAll().Select(x => x.GetRuntimeType())); + } + /// /// Gets the application tree for the applcation with the specified alias ///