public CodegenExpression Make(
     CodegenMethodScope parent,
     CodegenClassScope classScope)
 {
     var method = parent.MakeChild(typeof(StatementInformationalsRuntime), GetType(), classScope);
     var info = Ref("info");
     var annotationsExpr = _annotations == null
         ? ConstantNull()
         : LocalMethod(MakeAnnotations(typeof(Attribute[]), _annotations, method, classScope));
     method.Block
         .DeclareVar<StatementInformationalsRuntime>(
             info.Ref,
             NewInstance(typeof(StatementInformationalsRuntime)))
         .SetProperty(info, "StatementNameCompileTime", Constant(_statementNameCompileTime))
         .SetProperty(info, "IsAlwaysSynthesizeOutputEvents", Constant(_alwaysSynthesizeOutputEvents))
         .SetProperty(info, "OptionalContextName", Constant(_optionalContextName))
         .SetProperty(info, "OptionalContextModuleName", Constant(_optionalContextModuleName))
         .SetProperty(info, "OptionalContextVisibility", Constant(_optionalContextVisibility))
         .SetProperty(info, "IsCanSelfJoin", Constant(_canSelfJoin))
         .SetProperty(info, "HasSubquery", Constant(_hasSubquery))
         .SetProperty(info, "IsNeedDedup", Constant(_needDedup))
         .SetProperty(info, "IsStateless", Constant(_stateless))
         .SetProperty(info, "Annotations", annotationsExpr)
         .SetProperty(info, "UserObjectCompileTime", SerializerUtil.ExpressionForUserObject(_userObjectCompileTime))
         .SetProperty(info, "NumFilterCallbacks", Constant(_numFilterCallbacks))
         .SetProperty(info, "NumScheduleCallbacks", Constant(_numScheduleCallbacks))
         .SetProperty(info, "NumNamedWindowCallbacks", Constant(_numNamedWindowCallbacks))
         .SetProperty(info, "StatementType", Constant(_statementType))
         .SetProperty(info, "Priority", Constant(_priority))
         .SetProperty(info, "IsPreemptive", Constant(_preemptive))
         .SetProperty(info, "HasVariables", Constant(_hasVariables))
         .SetProperty(info, "IsWritesToTables", Constant(_writesToTables))
         .SetProperty(info, "HasTableAccess", Constant(_hasTableAccess))
         .SetProperty(info, "SelectClauseTypes", Constant(_selectClauseTypes))
         .SetProperty(info, "SelectClauseColumnNames", Constant(_selectClauseColumnNames))
         .SetProperty(info, "IsForClauseDelivery", Constant(_forClauseDelivery))
         .SetProperty(info, "GroupDeliveryEval", MultiKeyCodegen.CodegenExprEvaluatorMayMultikey(_groupDelivery, null, _groupDeliveryMultiKey, method, classScope))
         .SetProperty(info, "Properties", MakeProperties(_properties, method, classScope))
         .SetProperty(info, "HasMatchRecognize", Constant(_hasMatchRecognize))
         .SetProperty(info, "AuditProvider", MakeAuditProvider(method, classScope))
         .SetProperty(info, "IsInstrumented", Constant(_instrumented))
         .SetProperty(info, "InstrumentationProvider", MakeInstrumentationProvider(method, classScope))
         .SetProperty(info, "SubstitutionParamTypes", MakeSubstitutionParamTypes())
         .SetProperty(info, "SubstitutionParamNames", MakeSubstitutionParamNames(method, classScope))
         .SetProperty(info, "InsertIntoLatchName", Constant(_insertIntoLatchName))
         .SetProperty(info, "IsAllowSubscriber", Constant(_allowSubscriber))
         .SetProperty(info, "OnScripts", MakeOnScripts(_onScripts, method, classScope))
         .MethodReturn(info);
     return LocalMethod(method);
 }
        public CodegenExpression Make(
            CodegenMethodScope parent,
            SAIFFInitializeSymbol symbols,
            CodegenClassScope classScope)
        {
            var mode = _forge.FactoryMode;
            if (!(mode is VirtualDataWindowFactoryModeManaged)) {
                throw new ArgumentException("Unexpected factory mode " + mode);
            }

            var managed = (VirtualDataWindowFactoryModeManaged) mode;
            var injectionStrategy = (InjectionStrategyClassNewInstance) managed.InjectionStrategyFactoryFactory;
            var factoryField = classScope.AddDefaultFieldUnshared(
                true,
                typeof(VirtualDataWindowFactoryFactory),
                injectionStrategy.GetInitializationExpression(classScope));

            var builder = new SAIFFInitializeBuilder(
                typeof(VirtualDWViewFactory),
                GetType(),
                "factory",
                parent,
                symbols,
                classScope);
            builder
                .Eventtype("eventType", EventType)
                .Expression(
                    "factory",
                    ExprDotMethod(
                        factoryField,
                        "CreateFactory",
                        NewInstance(typeof(VirtualDataWindowFactoryFactoryContext))))
                .Constant("parameters", _parameterValues)
                .Expression(
                    "ParameterExpressions",
                    ExprNodeUtilityCodegen.CodegenEvaluators(
                        _validatedParameterExpressions,
                        builder.Method(),
                        GetType(),
                        classScope))
                .Constant("NamedWindowName", _namedWindowName)
                .Expression(
                    "compileTimeConfiguration",
                    SerializerUtil.ExpressionForUserObject(_customConfigs));
            return builder.Build();
        }
 private static CodegenExpression MakeModulePropValue(object value)
 {
     return SerializerUtil.ExpressionForUserObject(value);
 }