Exemplo n.º 1
0
        public void SetData(MObject data)
        {
            for (var i = 0; i < _binders.Count; i++)
            {
                var serializedBinder = _binders[i];
                //var modelMember = _modelMemberToBinderInfo[serializedBinder.FieldName];
                if (serializedBinder.BinderInstance == null)
                {
                    Debug.LogWarningFormat(this, "binder for [{0}] is null", serializedBinder.FieldName);
                    continue;
                }

                var value = data[serializedBinder.FieldName];

                BinderUtil.SetValueToBinder(value, serializedBinder.BinderInstance);
            }
        }
Exemplo n.º 2
0
        public MObject GetData()
        {
            var obj = new MObject();

            for (var i = 0; i < _binders.Count; i++)
            {
                var serializedBinder = _binders[i];

                if (serializedBinder.BinderInstance == null)
                {
                    Debug.LogWarningFormat(this, "binder for [{0}] is null", serializedBinder.FieldName);
                    continue;
                }

                obj.Add(serializedBinder.FieldName, BinderUtil.GetValueFromBinder(serializedBinder.BinderInstance));
            }
            return(obj);
        }