BindingMapping.cs 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Web.UI;
  6. using System.Reflection;
  7. using Bowin.Common.Utility;
  8. namespace Bowin.Common
  9. {
  10. public class BindingMapping
  11. {
  12. public Control Control { get; set; }
  13. public PropertyInfo ControlValueProperty { get; set; }
  14. public PropertyInfo DataSourceProperty { get; set; }
  15. public bool AutomaticBind { get; set; }
  16. public string FormatString { get; set; }
  17. public BindingMapping(Control control, PropertyInfo controlValueProperty, PropertyInfo dataSourceProperty)
  18. {
  19. Guard.ArgumentNotNullOrEmpty(control, "control");
  20. Guard.ArgumentNotNullOrEmpty(controlValueProperty, "controlValueProperty");
  21. Guard.ArgumentNotNullOrEmpty(dataSourceProperty, "dataSourceProperty");
  22. this.Control = control;
  23. this.ControlValueProperty = controlValueProperty;
  24. this.DataSourceProperty = dataSourceProperty;
  25. this.AutomaticBind = true;
  26. }
  27. }
  28. }