Microsoft.CSharp.RuntimeBinder.Semantics.ExprFactory.CreateIntegerConstant C# (CSharp) Method

CreateIntegerConstant() public method

public CreateIntegerConstant ( int x ) : Microsoft.CSharp.RuntimeBinder.Semantics.EXPRCONSTANT
x int
return Microsoft.CSharp.RuntimeBinder.Semantics.EXPRCONSTANT
        public EXPRCONSTANT CreateIntegerConstant(int x)
        {
            return CreateConstant(GetTypes().GetReqPredefAgg(PredefinedType.PT_INT).getThisType(), ConstValFactory.GetInt(x));
        }
        public EXPRCONSTANT CreateBoolConstant(bool b)

Usage Example

示例#1
0
        private static ExprArrayInit GenerateParamsArray(Expr args, PredefinedType pt)
        {
            int           parameterCount         = ExpressionIterator.Count(args);
            AggregateType paramsArrayElementType = SymbolLoader.GetPredefindType(pt);
            ArrayType     paramsArrayType        = TypeManager.GetArray(paramsArrayElementType, 1, true);
            ExprConstant  paramsArrayArg         = ExprFactory.CreateIntegerConstant(parameterCount);

            return(ExprFactory.CreateArrayInit(paramsArrayType, args, paramsArrayArg, new int[] { parameterCount }));
        }