public ContextControllerHashFactoryForge( ContextControllerFactoryEnv ctx, ContextSpecHash detail) : base(ctx) { this.detail = detail; }
private ContextControllerFactoryForge Make( ContextControllerFactoryEnv factoryContext, ContextSpec detail) { ContextControllerFactoryForge forge; if (detail is ContextSpecInitiatedTerminated) { forge = new ContextControllerInitTermFactoryForge( factoryContext, (ContextSpecInitiatedTerminated) detail); } else if (detail is ContextSpecKeyed) { forge = new ContextControllerKeyedFactoryForge(factoryContext, (ContextSpecKeyed) detail); } else if (detail is ContextSpecCategory) { forge = new ContextControllerCategoryFactoryForge(factoryContext, (ContextSpecCategory) detail); } else if (detail is ContextSpecHash) { forge = new ContextControllerHashFactoryForge(factoryContext, (ContextSpecHash) detail); } else { throw new UnsupportedOperationException( "Context detail " + detail + " is not yet supported in a nested context"); } return forge; }
private ContextControllerFactoryForge[] GetForges( string contextName, ContextSpec contextDetail) { if (!(contextDetail is ContextNested)) { var factoryEnv = new ContextControllerFactoryEnv( contextName, contextName, 1, 1); return new[] {Make(factoryEnv, contextDetail)}; } var nested = (ContextNested) contextDetail; var forges = new ContextControllerFactoryForge[nested.Contexts.Count]; var nestingLevel = 1; foreach (var desc in nested.Contexts) { var factoryEnv = new ContextControllerFactoryEnv( contextName, desc.ContextName, nestingLevel, nested.Contexts.Count); forges[nestingLevel - 1] = Make(factoryEnv, desc.ContextDetail); nestingLevel++; } return forges; }
public ContextControllerInitTermFactoryForge( ContextControllerFactoryEnv ctx, ContextSpecInitiatedTerminated detail) : base(ctx) { this.detail = detail; }
public ContextControllerKeyedFactoryForge( ContextControllerFactoryEnv ctx, ContextSpecKeyed detail) : base(ctx) { this.detail = detail; }
public ContextControllerCategoryFactoryForge( ContextControllerFactoryEnv ctx, ContextSpecCategory detail) : base(ctx) { this.detail = detail; }