Пример #1
0
        private void BoundControl_DataBound(object sender, System.EventArgs e)
        {
            if (HasParentControlCalledDataBinding)
            {
                return;
            }
            Type type = sender.GetType();

            _datasource = type.GetProperty("DataSource");
            if (_datasource == null)
            {
                throw new NotSupportedException("分页控件要求表现控件必需包含一个DataSource。");
            }
            object data = _datasource.GetGetMethod().Invoke(sender, null);

            _builder = Adapters[data.GetType()];
            if (_builder == null)
            {
                throw new NullReferenceException("没有安装适当的适配器来处理下面的数据源类型:" + data.GetType());
            }
            _builder.Source = data;

            ApplyDataSensitivityRules();
            BindParent();
            RaiseEvent(DataUpdate, this);
        }
Пример #2
0
        private void BoundControl_DataBound(object sender, System.EventArgs e)
        {
            if (HasParentControlCalledDataBinding) return;
            Type type = sender.GetType();
            _datasource = type.GetProperty("DataSource");
            if (_datasource == null)
                throw new NotSupportedException("分页控件要求表现控件必需包含一个DataSource。");
            object data = _datasource.GetGetMethod().Invoke(sender, null);
            _builder = Adapters[data.GetType()];
            if (_builder == null)
                throw new NullReferenceException("没有安装适当的适配器来处理下面的数据源类型:" + data.GetType());
            _builder.Source = data;

            ApplyDataSensitivityRules();
            BindParent();
            RaiseEvent(DataUpdate, this);
        }
Пример #3
0
 public void Add(Type key, AdapterBuilder value)
 {
     Dictionary.Add(GetKey(key), value);
 }
Пример #4
0
 public void Add(Type key, AdapterBuilder value)
 {
     Dictionary.Add(GetKey(key), value);
 }