Commit 3ce2bec7 authored by 潘栩锋's avatar 潘栩锋 🚴

优化 fobj.Reflect "asyncDelegate","asyncContext" 为const string

parent 1d3da326
...@@ -9,6 +9,9 @@ namespace FObjBase.Reflect ...@@ -9,6 +9,9 @@ namespace FObjBase.Reflect
{ {
public class Reflect_OBJ_INTERFACE public class Reflect_OBJ_INTERFACE
{ {
public const string asyncDelegate = "asyncDelegate";
public const string asyncContext = "asyncContext";
#region Push #region Push
public const UInt16 PUSH_Event = 101; public const UInt16 PUSH_Event = 101;
public const UInt16 PUSH_PropertyChanged = 102; public const UInt16 PUSH_PropertyChanged = 102;
......
...@@ -332,11 +332,11 @@ namespace FObjBase.Reflect ...@@ -332,11 +332,11 @@ namespace FObjBase.Reflect
{ {
var ptype = parameterInfos[i].ParameterType; var ptype = parameterInfos[i].ParameterType;
var pname = parameterInfos[i].Name; var pname = parameterInfos[i].Name;
if (string.Compare(pname, "asyncDelegate", true) == 0) if (string.Compare(pname, Reflect_OBJ_INTERFACE.asyncDelegate, true) == 0)
{ {
parameters[i] = new AsyncCBHandler(asyncDelegate); parameters[i] = new AsyncCBHandler(asyncDelegate);
} }
else if (string.Compare(pname, "asyncContext", true) == 0) else if (string.Compare(pname, Reflect_OBJ_INTERFACE.asyncContext, true) == 0)
{ {
parameters[i] = new CC { from = from, srcid = srcid, magic = magic, methodName = rData.name }; parameters[i] = new CC { from = from, srcid = srcid, magic = magic, methodName = rData.name };
} }
...@@ -367,8 +367,8 @@ namespace FObjBase.Reflect ...@@ -367,8 +367,8 @@ namespace FObjBase.Reflect
//全部参数名称 //全部参数名称
var names = parameterInfos.Select(pi => pi.Name).ToList(); var names = parameterInfos.Select(pi => pi.Name).ToList();
//删除掉 asyncDelegate,asyncContext //删除掉 asyncDelegate,asyncContext
names.Remove("asyncDelegate"); names.Remove(Reflect_OBJ_INTERFACE.asyncDelegate);
names.Remove("asyncContext"); names.Remove(Reflect_OBJ_INTERFACE.asyncContext);
var names_req = parameterNames; var names_req = parameterNames;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment