Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }
Exemple #4
0
        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);
        }
Exemple #5
0
 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}");
 }
Exemple #6
0
 public UIDataCellCallback(UIBindRoot root, string bindFuncName, UIDataCell cell)
 {
     this.Root         = root;
     this.BindFuncName = bindFuncName;
     this.Cell         = cell;
 }