@@ -12,7 +12,7 @@ namespace Ivy.Core.Plugins;
1212/// This is an internal implementation detail of the plugin hosting infrastructure.
1313/// Plugins should only depend on the <see cref="IIvyPluginContext"/> (or derived) interfaces.
1414/// </summary>
15- public abstract class PluginContextBase : IIvyExtendedPluginContext , IPluginServiceProvider , IPluginMenuContributions
15+ public abstract class PluginContextBase : IIvyExtendedPluginContext , IPluginServiceProvider
1616{
1717 protected AppRepository AppRepository { get ; }
1818 protected IReadOnlySet < string > ReservedPaths { get ; }
@@ -31,7 +31,6 @@ protected PluginContextBase(AppRepository appRepository, IReadOnlySet<string> re
3131 ReservedPaths = reservedPaths ;
3232 Builder = builder ;
3333 }
34- private readonly List < ( Func < IEnumerable < MenuItem > , IEnumerable < MenuItem > > Transformer , int Priority ) > _menuTransformers = [ ] ;
3534 private readonly List < Action < WebApplication > > _appActions = [ ] ;
3635 private readonly AggregatePluginServiceProvider _aggregateProvider = new ( ) ;
3736 private readonly Dictionary < string , PluginState > _pluginStates = new ( ) ;
@@ -59,23 +58,6 @@ public IServiceCollection Services
5958 internal void SetPluginConfig ( IIvyPluginConfig config ) => _currentPluginConfig = config ;
6059 internal void ClearPluginConfig ( ) => _currentPluginConfig = null ;
6160
62- public IReadOnlyList < Func < IEnumerable < MenuItem > , IEnumerable < MenuItem > > > MenuTransformers
63- {
64- get
65- {
66- _lock . EnterReadLock ( ) ;
67- try
68- {
69- return _menuTransformers
70- . OrderBy ( t => t . Priority )
71- . Select ( t => t . Transformer )
72- . ToList ( ) ;
73- }
74- finally { _lock . ExitReadLock ( ) ; }
75- }
76- }
77-
78-
7961 internal void SetCurrentPlugin ( string pluginId , string directory )
8062 {
8163 _currentPluginId = pluginId ;
@@ -111,20 +93,6 @@ public void AddAppsFromAssembly(Assembly assembly)
11193 state . AppFactories . Add ( factory ) ;
11294 }
11395
114- public void TransformMenuItems ( Func < IEnumerable < MenuItem > , IEnumerable < MenuItem > > transformer , int priority = 0 )
115- {
116- _lock . EnterWriteLock ( ) ;
117- try
118- {
119- _menuTransformers . Add ( ( transformer , priority ) ) ;
120- if ( _currentPluginId is not null && _pluginStates . TryGetValue ( _currentPluginId , out var state ) )
121- state . MenuTransformers . Add ( ( transformer , priority ) ) ;
122- }
123- finally
124- {
125- _lock . ExitWriteLock ( ) ;
126- }
127- }
12896
12997
13098 public void UseWebApplication ( Action < WebApplication > configure )
@@ -206,9 +174,6 @@ internal virtual void RemovePluginContributions(string pluginId)
206174 // Collect app IDs before removing factories so we can reload affected sessions
207175 affectedAppIds = GetAppIdsFromFactories ( state . AppFactories ) ;
208176
209- foreach ( var t in state . MenuTransformers )
210- _menuTransformers . Remove ( t ) ;
211-
212177 foreach ( var a in state . AppActions )
213178 _appActions . Remove ( a ) ;
214179
0 commit comments