Ejemplo n.º 1
0
        protected override void CollectPropertyLists()
        {
            var bindingMode = (BindingMode)_bindingModeProp.enumValueIndex;

            base.CollectPropertyLists();

            if (_viewModelChanged)
            {
                _srcNames.Value = null;
                _srcPaths.Value = null;
            }

            if (string.IsNullOrEmpty(_viewModelProp.Value))
            {
                return;
            }

            var view = _dstViewProp.objectReferenceValue as Component;

            _srcNames.Clear();
            _srcPaths.Clear();
            _dstNames.Clear();
            _dstPaths.Clear();

            _dstChangeEvents.Clear();


            if (view)
            {
                var dstNeedsGetter = bindingMode != BindingMode.OneWay;
                var dstNeedsSetter = bindingMode != BindingMode.OneWayToSource;

                _dstNames.Values        = view.GetBindablePropertyList(needsGetter: dstNeedsGetter, needsSetter: dstNeedsSetter);
                _dstPaths.Values        = view.GetPropertiesAndFieldsList(_dstNames.Value);
                _dstChangeEvents.Values = view.GetBindableEventsList();
            }
            else
            {
                _dstNames.Value        = null;
                _dstPaths.Value        = null;
                _dstChangeEvents.Value = null;
            }

            var vmType = ViewModelProvider.GetViewModelType(ViewModelName);

            _srcNames.Values = ViewModelProvider.GetViewModelPropertyList(ViewModelName);

            var propType = vmType.GetProperty(_srcNames.Value)?.PropertyType;

            if (propType != null)
            {
                _srcPaths.Values = propType.GetNestedFields();
            }
        }
Ejemplo n.º 2
0
        protected override void CollectPropertyLists()
        {
            base.CollectPropertyLists();

            if (_viewModelChanged)
            {
                _srcCollectionNames.Value = null;
            }

            _srcCollectionNames.Clear();


            _srcCollectionNames.Values
                = ViewModelProvider.GetViewModelPropertyList <INotifyCollectionChanged>(_viewModelProp.Value);
        }
Ejemplo n.º 3
0
        protected override void CollectPropertyLists()
        {
            base.CollectPropertyLists();

            var view = _dstViewProp.objectReferenceValue as UnityEngine.Component;

            _eventNames.Clear();

            if (view)
            {
                _eventNames.Values = view.GetBindableEventsList();
            }
            else
            {
                _eventNames.Value = null;
            }
        }
Ejemplo n.º 4
0
        protected override void CollectPropertyLists()
        {
            base.CollectPropertyLists();

            if (_viewModelChanged)
            {
                _srcNames.Value = null;
                _srcPaths.Value = null;
            }

            if (string.IsNullOrEmpty(_viewModelProp.Value))
            {
                return;
            }

            var view = _dstViewProp.objectReferenceValue as Component;

            _srcNames.Clear();
            _srcPaths.Clear();
            _dstNames.Clear();
            _dstPaths.Clear();


            if (view)
            {
                _dstNames.Values = view.GetBindablePropertyList(needsGetter: false);
                _dstPaths.Values = view.GetPropertiesAndFieldsList(_dstNames.Value);
            }
            else
            {
                _dstNames.Value = null;
                _dstPaths.Value = null;
            }

            var vmType = ViewModelProvider.GetViewModelType(ViewModelName);

            _srcNames.Values = ViewModelProvider.GetViewModelPropertyList(ViewModelName);

            var propType = vmType.GetProperty(_srcNames.Value)?.PropertyType;

            if (propType != null)
            {
                _srcPaths.Values = propType.GetNestedFields();
            }
        }
Ejemplo n.º 5
0
        protected override void CollectPropertyLists()
        {
            base.CollectPropertyLists();

            _eventNames.Clear();
            _methodNames.Clear();

            var view = _srcViewProp.objectReferenceValue as Component;

            if (view)
            {
                _eventNames.Values = view.GetBindableEventsList();
            }

            else
            {
                _eventNames.Value = null;
            }


            _methodNames.Values = ViewModelProvider.GetViewModelMethodNames(ViewModelName);
        }
        protected override void CollectPropertyLists()
        {
            var myClass = target as CollectionViewBase;

            _selectedItemNames.Clear();
            _selectedItemCollectionNames.Clear();

            var collectionName = myClass.SrcCollectionName;

            if (!string.IsNullOrEmpty(collectionName))
            {
                var list = new List <string>();

                var listType = ViewModelProvider
                               .GetViewModelType(myClass.ViewModelName)
                               .GetProperty(collectionName)
                               .PropertyType
                               .GenericTypeArguments
                               .FirstOrDefault();

                var listCollectionType = typeof(ObservableCollection <>)
                                         .MakeGenericType(listType);


                list.Add("--");
                list.AddRange(ViewModelProvider.GetViewModelPropertyList(myClass.ViewModelName,
                                                                         _canSelectMultipleProp.boolValue ? listCollectionType : listType));

                if (_canSelectMultipleProp.boolValue)
                {
                    _selectedItemCollectionNames.Values = list;
                }
                else
                {
                    _selectedItemNames.Values = list;
                }
            }
        }
        protected override void CollectPropertyLists()
        {
            if (collectionView == null)
            {
                collectionView = (target as Component).gameObject.GetComponentInParent <ICollectionViewItem>();
            }

            _srcNames.Clear();
            _srcPaths.Clear();
            _dstNames.Clear();
            _dstPaths.Clear();

            var dstView = _dstViewProp.objectReferenceValue as Component;

            if (dstView)
            {
                _dstNames.Values = dstView.GetBindablePropertyList(needsGetter: false);
                _dstPaths.Values = dstView.GetPropertiesAndFieldsList(_dstNames.Value);
            }
            else
            {
                _dstNames.Value = null;
                _dstPaths.Value = null;
            }

            if (collectionView != null)
            {
                var modelType = collectionView.ModelType;
                _srcNames.Values = modelType.GetBindablePropertyNames(needsSetter: false);

                var propType = modelType.GetProperty(_srcNames.Value).PropertyType;
                if (propType != null)
                {
                    _srcPaths.Values = propType.GetNestedFields();
                }
            }
        }