Esempio n. 1
0
 public MethodCodeGen(CodeGenerator cg, MethodBindingInfo bindingInfo)
     : base(cg)
 {
     this.bindingInfo = bindingInfo;
     WriteAllVariants(this.bindingInfo);
     // WriteTSAllVariants(this.bindingInfo);
 }
Esempio n. 2
0
        public void AddMethod(MethodInfo methodInfo, bool isIndexer, string renameRegName)
        {
            if (this.transform != null)
            {
                if (this.transform.IsBlocked(methodInfo))
                {
                    bindingManager.Info("skip blocked method: {0}", methodInfo.Name);
                    return;
                }
            }
            var isExtension = methodInfo.IsDefined(typeof(System.Runtime.CompilerServices.ExtensionAttribute));
            var isStatic    = methodInfo.IsStatic && !isExtension;
            var group       = isStatic ? staticMethods : methods;
            MethodBindingInfo overrides;
            var methodName = TypeBindingInfo.GetNamingAttribute(methodInfo);

            if (!group.TryGetValue(methodName, out overrides))
            {
                overrides = new MethodBindingInfo(isIndexer, isStatic, methodName, renameRegName ?? methodName);
                group.Add(methodName, overrides);
            }
            overrides.Add(methodInfo, isExtension);
            CollectDelegate(methodInfo);
            bindingManager.Info("[AddMethod] {0}.{1}", type, methodInfo);
        }