public static Delegate CreateDelegate(Type t, LuaFunction func, LuaTable self) { DelegateValue Create = null; if (!dict.TryGetValue(t, out Create)) { throw new LuaException(string.Format("Delegate {0} not register", LuaMisc.GetTypeName(t))); } if (func != null) { LuaState state = func.GetLuaState(); LuaDelegate target = state.GetLuaDelegate(func, self); if (target != null) { return(Delegate.CreateDelegate(t, target, target.method)); } else { Delegate d = Create(func, self, true); target = d.Target as LuaDelegate; state.AddLuaDelegate(target, func, self); return(d); } } return(Create(func, self, true)); }
public void SetValue(int value) { //if中的代码判断是不是异步刷新UI,如果是的话,就Invoke到主线程执行else if (InvokeRequired) { if (Disposing || IsDisposed) { return; } DelegateValue @delegate = new DelegateValue(SetValue); Invoke(@delegate, value); } else { Value = value; if (value == 0) { Maximum = 100; ChuckColor = Color.FromArgb(0, 142, 250); progressState = ProgressState.Progress; } else if (value == Maximum) { progressState = ProgressState.Success; Visible = false; } StateChange(); Refresh(); } }
public static Delegate CreateDelegate(Type t, LuaFunction func, LuaTable self) { DelegateValue create = null; if (!dict.TryGetValue(t, out create)) { throw new LuaException(string.Format("Delegate {0} not register", LuaMisc.GetTypeName(t))); } return(create(func, self, true)); }
public static Delegate CreateDelegate(Type t, LuaFunction func) { DelegateValue create = null; if (!dict.TryGetValue(t, out create)) { Debugger.LogError("Delegate {0} not register", t.FullName); return(null); } return(create(func)); }
public static Delegate CreateDelegate(IntPtr L, Type t, LuaFunction func = null) { DelegateValue create = null; if (!dict.TryGetValue(t, out create)) { LuaDLL.luaL_error(L, string.Format("Delegate {0} not register", LuaMisc.GetTypeName(t))); return(null); } return(create(func)); }
public static Delegate CreateDelegate(Type t, LuaFunction func = null) { DelegateValue create = null; if (!dict.TryGetValue(t, out create)) { throw new LuaException(string.Format("Delegate {0} not register", LuaMisc.GetTypeName(t))); } if (!dict2.ContainsKey(func)) { Delegate del = create(func); dict2[func] = del; dict3[del] = func; } return(dict2[func]); }
public ObjectValue VisitDelegateValue(DelegateValue v) { throw new NotImplementedException(); }