TinyEE.DLRUtil.GetFunctionCallBinder C# (CSharp) Method

GetFunctionCallBinder() static private method

static private GetFunctionCallBinder ( string name, int argsCount, bool isStatic = true ) : System.Runtime.CompilerServices.CallSiteBinder
name string
argsCount int
isStatic bool
return System.Runtime.CompilerServices.CallSiteBinder
        internal static CallSiteBinder GetFunctionCallBinder(string name, int argsCount = 0, bool isStatic = true)
        {
            return Binder.InvokeMember(CSharpBinderFlags.None,
                                        name,
                                        null,
                                        typeof(object),
                                        new[] {
                                            isStatic
                                                ? CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.IsStaticType, null)
                                                : CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null)
                                        }
                                        .Concat(GetArgInfo(argsCount)));
        }

Usage Example

Exemplo n.º 1
0
        private static CallSiteBinder GetFunctionCallBinder(IList <ParseNode> nodes, int argCount, bool isStatic)
        {
            var funcText = nodes[0].Token.Text;

            Debug.Assert(funcText.Length >= 2 && funcText.EndsWith("("));
            var funcName = funcText.Substring(0, funcText.Length - 1);

            if (isStatic)
            {
                funcName = funcName.ToUpperInvariant();
            }
            return(DLRUtil.GetFunctionCallBinder(funcName, argCount, isStatic));
        }
All Usage Examples Of TinyEE.DLRUtil::GetFunctionCallBinder