示例#1
0
        private bool ApplyFilters(DataBindingBase arg)
        {
            var oneWay      = arg as OneWayDataBinding;
            var dataBinding = arg as DataBinding;

            if (oneWay)
            {
                if (_filterBy == FilterType.None)
                {
                    return(true);
                }
                if (oneWay.Connection == null)
                {
                    return(false);
                }
                return(_filterBy == FilterType.Bound ? oneWay.Connection.IsBound : !oneWay.Connection.IsBound);
            }
            else if (dataBinding)
            {
                if (_filterBy == FilterType.None)
                {
                    return(true);
                }
                if (dataBinding.Connection == null)
                {
                    return(false);
                }
                return(_filterBy == FilterType.Bound ? dataBinding.Connection.IsBound : !dataBinding.Connection.IsBound);
            }
            else
            {
                return(false);
            }
        }
示例#2
0
 private void DrawBindings(DataBindingBase item)
 {
     if (item is OneWayDataBinding)
     {
         DrawOneWay(item as OneWayDataBinding);
     }
     else if (item is DataBinding)
     {
         DrawBinding(item as DataBinding);
     }
 }
        private static bool TestDataBinding(DataBindingBase binding, Type testCaseType, out Stack <string> errors)
        {
            var ict = binding as IConnectionTestEventReciver;

            ict?.PreConnectionTest();

            var testCase = Activator.CreateInstance(testCaseType, new[] { binding }) as IDataBindingTestCase;
            var rValue   = testCase.ExecuteTest() == true;

            errors = testCase.Errors;
            ict?.PostConnectionTest();
            return(rValue);
        }
示例#4
0
        public override void OnInspectorGUI()
        {
            if (!(target is CollectionViewSource myClass))
            {
                return;
            }

            _srcIndex = myClass.SrcCollectionName is null
                ? -1
                : DataBindingBase.GetIndexOfBindablePropertyInfo(myClass.SrcCollectionName, ViewModelProvider.GetViewModelType(myClass.ViewModelName), myClass.SrcCollections);

            base.OnInspectorGUI();
        }
示例#5
0
        protected virtual void OnEnable()
        {
            BindingBase = target as DataBindingBase;

            if (AdapterLookup.Count <= 0)
            {
                CollectAdapters();
            }

            if (ViewCollectionChangedHandlerTypes.Count <= 0)
            {
                CollectViewHandlers();
            }
        }
 public VisibilityBindingTestCase(DataBindingBase binder) : base(binder)
 {
 }
 public TwoWayDataBindingTestCase(DataBindingBase binder) : base(binder)
 {
     _binder = binder as TwoWayDataBinding;
 }
示例#8
0
 private object ApplyOrder(DataBindingBase arg)
 {
     return(_orderBy == OrderType.GameObject ? arg.gameObject.name : arg.ViewModelName);
 }
 public CollectionViewSourceTestCase(DataBindingBase binder) : base(binder)
 {
     _binder = binder as CollectionViewSource;
 }
 public OneWayDataBindingTestCase(DataBindingBase binder) : base(binder)
 {
     _binder = binder as OneWayDataBinding;
 }
 public DataBindingTestCaseBase(DataBindingBase binder)
 {
     _binder = binder as DataBindingBase;
 }