public void BindingContext_Clear_Empty_Success()
        {
            var context = new BindingContext();

            context.Clear();
            Assert.Empty(context);

            // Clear again.
            context.Clear();
            Assert.Empty(context);
        }
        public void BindingContext_Clear_NotEmpty_Success()
        {
            var context = new BindingContext();
            var source  = new BindingSource();

            context.Add(new DataSource(), source.CurrencyManager);

            // Clear again.
            context.Clear();
            Assert.Empty(context);

            context.Clear();
            Assert.Empty(context);
        }
예제 #3
0
        private void UninitializeBindingContext()
        {
            if (_bindingContext == null)
            {
                return;
            }

            _bindingContext.BindingUpdateRequired -= OnBindingUpdateRequired;
            _bindingContext.Clear();
            _bindingContext = null;
        }