public int CreateCellOnRoot(GameObject gameObject, string bindFuncName, string bindDataName, object param) { var dataSet = this.BindView; UIDataCell cell = new UIDataCell(bindDataName, dataSet, param, gameObject); UIDataCellCallback callback = new UIDataCellCallback(this, bindFuncName, cell); dataSet.AddListener(bindDataName, callback.Run); this.callbacks.Add(callback); return(this.callbacks.Count); }
public int CreateCellOnArray(GameObject gameObject, string bindFuncName, string bindDataName, BaseUIBindArray array, int index, object param) { var dataSet = array.Data[index]; UIDataCell cell = new UIDataCell(bindDataName, dataSet, param, gameObject); UIDataCellCallback callback = new UIDataCellCallback(this, bindFuncName, cell); dataSet.AddListener(bindDataName, callback.Run); this.callbacks.Add(callback); return(this.callbacks.Count); }
public int CreateCellOnGroup(GameObject gameObject, string bindFuncName, string bindDataName, BaseUIBindGroup group, object param) { var dataSet = group.DataSet; UIDataCell cell = new UIDataCell(bindDataName, dataSet, param, gameObject); UIDataCellCallback callback = new UIDataCellCallback(this, bindFuncName, cell); dataSet.AddListener(bindDataName, callback.Run); this.callbacks.Add(callback); return(this.callbacks.Count); }
public bool InvokeBindMethod(string bindFuncName, UIDataCell cell) { MethodInfo method; if (this.methods.TryGetValue(bindFuncName, out method)) { param[0] = cell; method.Invoke(this, param); param[0] = null; return(true); } return(false); }
private void InvokeBindMethod(string bindFuncName, UIDataCell cell) { if (this.BindView.InvokeBindMethod(bindFuncName, cell)) { return; } if (OnInvokeBindMethod != null && OnInvokeBindMethod.Invoke(bindFuncName, cell)) { return; } if (UIBindUtils.InvokeBindMethod(bindFuncName, cell)) { return; } throw new Exception($"Bind Function Not Found: ${bindFuncName}"); }
public UIDataCellCallback(UIBindRoot root, string bindFuncName, UIDataCell cell) { this.Root = root; this.BindFuncName = bindFuncName; this.Cell = cell; }