示例#1
0
        public static string UnsupportedSourceTypeForAggregateFunction(AggregateFunctionContext context)
        {
            StringBuilder error = GetIntro(context.Member);

            error.AppendFormat("Aggregate function '{0}' doesn't support type '{1}' as source type",
                               context.ImplementationType, context.Member.Type);
            return(error.ToString());
        }
示例#2
0
        public override IEnumerable <CodeStatement> GetInitializationStatements(AggregateFunctionContext context)
        {
            List <CodeStatement> statements = new List <CodeStatement>(base.GetInitializationStatements(context));

            CodeStatement st = new CodeVariableDeclarationStatement(typeof(int),
                                                                    GetCounterObjectName(context),
                                                                    new CodeSnippetExpression("0"));

            statements.Add(st);

            return(statements);
        }
示例#3
0
 protected override string GetFormatForExecutedExpression(AggregateFunctionContext context)
 {
     // todo: test
     return(string.Format("FN_OBJ = FN_OBJ + CURR_ITEM; {0}++;", GetCounterObjectName(context)));
 }
示例#4
0
 private static string GetCounterObjectName(AggregateFunctionContext context)
 {
     return(context.FunctionObjectName + "_Cnt");
 }