예제 #1
0
 public PrependDsl Prepend <TPrepend>(
     Func <TContext, bool> predicate = null, bool @default = false)
     where TPrepend : TPlugin
 {
     return(Prepend(ConditionalPlugin <TPlugin, TContext>
                    .Create <TPrepend>(predicate ?? DefaultPredicate, Plugins.Singleton), @default));
 }
예제 #2
0
 public ConditionalPluginsDsl <TPlugin, TContext> WithOrAppend <TReplacement>(
     TReplacement instance, Func <TContext, bool> predicate = null,
     bool dispose = false, bool @default = false)
     where TReplacement : TPlugin
 {
     return(WithOrAppend(ConditionalPlugin <TPlugin, TContext>
                         .Create(instance, predicate ?? _defaultPredicate, dispose), @default));
 }
예제 #3
0
 public ConditionalPluginsDsl <TPlugin, TContext> WithOrAppend <TReplacement>(
     Func <TContext, bool> predicate = null, bool @default = false)
     where TReplacement : TPlugin
 {
     return(WithOrAppend(ConditionalPlugin <TPlugin, TContext>
                         .Create <TReplacement>(predicate ?? _defaultPredicate,
                                                _plugins.Singleton), @default));
 }
예제 #4
0
 public PrependDsl Prepend <TPrepend>(
     TPrepend instance, Func <TContext, bool> predicate = null,
     bool dispose = false, bool @default = false)
     where TPrepend : TPlugin
 {
     return(Prepend(ConditionalPlugin <TPlugin, TContext>
                    .Create(instance, predicate ?? DefaultPredicate, dispose), @default));
 }
예제 #5
0
 private ConditionalPluginsDsl <TPlugin, TContext> WithOrPrepend(
     ConditionalPlugin <TPlugin, TContext> plugin, bool @default = false)
 {
     _plugins.ReplaceAllOfTypeWithOrPrepend <TReplace>(plugin, @default);
     return(_dsl);
 }
예제 #6
0
 public PrependDsl(ConditionalPlugin <TPlugin, TContext> plugin,
                   ConditionalPlugins <TPlugin, TContext> plugins,
                   Func <TContext, bool> defaultPredicate) : base(plugins, defaultPredicate)
 {
     _plugin = plugin;
 }
예제 #7
0
 private PrependDsl Prepend(
     ConditionalPlugin <TPlugin, TContext> plugin, bool @default = false)
 {
     Plugins.Prepend(plugin, @default);
     return(new PrependDsl(plugin, Plugins, DefaultPredicate));
 }
예제 #8
0
 public ConditionalPlugins(
     IEnumerable <ConditionalPlugin <TPlugin, TContext> > plugins,
     bool singleton, ConditionalPlugin <TPlugin, TContext> @default) :
     base(plugins, singleton, @default)
 {
 }
예제 #9
0
 private ConditionalPlugin(ConditionalPlugin <TPlugin, TContext> source) : base(source)
 {
     AppliesTo = source.AppliesTo;
 }