protected override void DefineShutdownSyntax(ISyntaxBuilder <ICustomExtension> syntax)
 {
     syntax
     .Execute(() => CustomExtensionBase.DumpAction("CustomShutdown"))
     .Execute(() => "ShutdownTest", (extension, ctx) => extension.Unregister(ctx))
     .Execute(() => this.ShutdownInitializeConfiguration(), (extension, dictionary) => extension.DeConfigure(dictionary))
     .Execute(extension => extension.Stop());
 }
 protected override void DefineRunSyntax(ISyntaxBuilder <ICustomExtension> builder)
 {
     builder
     .Execute(() => CustomExtensionBase.DumpAction("CustomRun"))
     .Execute(extension => extension.Start())
     .Execute(() => this.RunInitializeConfiguration(), (extension, dictionary) => extension.Configure(dictionary))
     .Execute(extension => extension.Initialize())
     .Execute(() => "RunTest", (extension, ctx) => extension.Register(ctx));
 }
Beispiel #3
0
 protected override void DefineShutdownSyntax(ISyntaxBuilder <ICustomExtension> builder)
 {
     builder
     .Begin
     .With(new Behavior("shutdown first beginning"))
     .With(() => new Behavior("shutdown second beginning"))
     .Execute(() => CustomExtensionBase.DumpAction("CustomShutdown"))
     .Execute(() => "ShutdownTest", (extension, ctx) => extension.Unregister(ctx))
     .With(context => new BehaviorWithStringContext(context, "ShutdownTestValueFirst"))
     .With(context => new BehaviorWithStringContext(context, "ShutdownTestValueSecond"))
     .Execute(() => this.ShutdownInitializeConfiguration(), (extension, dictionary) => extension.DeConfigure(dictionary))
     .With(dictionary => new BehaviorWithConfigurationContext(dictionary, "ShutdownFirstValue", "ShutdownTestValue"))
     .With(dictionary => new BehaviorWithConfigurationContext(dictionary, "ShutdownSecondValue", "ShutdownTestValue"))
     .Execute(extension => extension.Stop())
     .With(new Behavior("shutdown first stop"))
     .With(() => new Behavior("shutdown second stop"))
     .End
     .With(new Behavior("shutdown first end"))
     .With(() => new Behavior("shutdown second end"))
     .With(new DisposeExtensionBehavior());
 }
Beispiel #4
0
 protected override void DefineRunSyntax(ISyntaxBuilder <ICustomExtension> builder)
 {
     builder
     .Begin
     .With(new Behavior("run first beginning"))
     .With(() => new Behavior("run second beginning"))
     .Execute(() => CustomExtensionBase.DumpAction("CustomRun"))
     .Execute(extension => extension.Start())
     .With(new Behavior("run first start"))
     .With(() => new Behavior("run second start"))
     .Execute(() => this.RunInitializeConfiguration(), (extension, dictionary) => extension.Configure(dictionary))
     .With(dictionary => new BehaviorWithConfigurationContext(dictionary, "RunFirstValue", "RunTestValue"))
     .With(dictionary => new BehaviorWithConfigurationContext(dictionary, "RunSecondValue", "RunTestValue"))
     .Execute(extension => extension.Initialize())
     .With(new Behavior("run first initialize"))
     .With(() => new Behavior("run second initialize"))
     .Execute(() => "RunTest", (extension, context) => extension.Register(context))
     .With(context => new BehaviorWithStringContext(context, "RunTestValueFirst"))
     .With(context => new BehaviorWithStringContext(context, "RunTestValueSecond"))
     .End
     .With(new Behavior("run first end"))
     .With(() => new Behavior("run second end"));
 }