提交 1645507b 编写于 作者: J johnche(车雄生)

上个提交的优化:避免为扩展类和被扩展类同时加了LuaCallCSharp时,生成delegate

上级 f78fd673
......@@ -1090,12 +1090,23 @@ namespace CSObjectWrapEditor
string filePath = GeneratorConfig.common_path + "XLuaGenAutoRegister.cs";
StreamWriter textWriter = new StreamWriter(filePath, false, Encoding.UTF8);
var extension_methods = from t in ReflectionUse.Concat(LuaCallCSharp)
var lookup = LuaCallCSharp.Distinct().ToDictionary(t => t);
var extension_methods_from_lcs = (from t in LuaCallCSharp
where isDefined(t, typeof(ExtensionAttribute))
from method in t.GetMethods(BindingFlags.Static | BindingFlags.Public)
where isDefined(method, typeof(ExtensionAttribute))
where !method.ContainsGenericParameters || isSupportedGenericMethod(method)
select makeGenericMethodIfNeeded(method);
select makeGenericMethodIfNeeded(method))
.Where(method => !lookup.ContainsKey(method.GetParameters()[0].ParameterType));
var extension_methods = (from t in ReflectionUse
where isDefined(t, typeof(ExtensionAttribute))
from method in t.GetMethods(BindingFlags.Static | BindingFlags.Public)
where isDefined(method, typeof(ExtensionAttribute))
where !method.ContainsGenericParameters || isSupportedGenericMethod(method)
select makeGenericMethodIfNeeded(method)).Concat(extension_methods_from_lcs);
GenOne(typeof(DelegateBridgeBase), (type, type_info) =>
{
#if GENERIC_SHARING
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册