private object OnGetTreeValueEvent(CustomClass sender, TreeValueEventArgs e) { CustomClass parent = sender; CustomProperty prop = e.tree; object svalue = null; try { if (m_lua != null && prop.ID != null) { this.DoScript(prop); LuaFunction fun = m_lua.GetFunction(GetRealFunctionName(prop.Key, "ongettreevalue"));//"__fname__" + prop.Key + ".ongetreevalue"); if (fun != null) { CustomClass child = (CustomClass)e.tree.Value; svalue = child.Value;//e.tree.Description; object[] retobjs = fun.Call(prop, e); if (retobjs != null && retobjs.GetLength(0) > 0) { if (retobjs[0] is bool) { if ((bool)retobjs[0] == true && retobjs.GetLength(0) > 1) return retobjs[1]; } } } } } catch (Exception ex) { //ScriptDebugForm frm = Program.MainForm.DebugForm; //frm.OutputBox.Text += ex.Message + "\r\n"; //frm.Show(); //frm.BringToFront(); Helper.AddLog(ex.Message); } return svalue;//取消修改值,或者未更改值 }
private object OnGetTreeValue(CustomClass sender, TreeValueEventArgs e) { CustomClass prop = sender; string svalue = e.tree.Description; try { if (m_lua != null && prop.ID != null) { DoScript(prop.ID); LuaFunction fun = m_lua.GetFunction("__fname__" + prop.ID + ".ongetreevalue"); if (fun != null) { object[] retobjs = fun.Call(prop, e); if (retobjs.GetLength(0) > 0) { if (retobjs[0] is bool) { if ((bool)retobjs[0] == true && retobjs.GetLength(0) > 1) return retobjs[1]; } } } } } catch (Exception ex) { ScriptDebugForm frm = ((MainForm)ParentForm).DebugForm; frm.OutputBox.Text += ex.Message + "\r\n"; frm.Show(); frm.BringToFront(); } return svalue;//取消修改值,或者未更改值 }