main
 1using System;
 2using System.Linq.Expressions;
 3using System.Windows.Forms;
 4
 5namespace MoMoney.Presentation.Winforms.Databinding
 6{
 7    public static class Create
 8    {
 9        public static IBindingSelector<TypeToBindTo> binding_for<TypeToBindTo>(TypeToBindTo thing_to_bind_to)
10        {
11            return new BindingSelector<TypeToBindTo>(thing_to_bind_to, new PropertyInspectorFactory());
12        }
13
14        public static IPropertyBinding<TypeOfProperty> bind_to<TypeToBindTo, TypeOfProperty>(
15            this Control control,
16            TypeToBindTo dto,
17            Expression<Func<TypeToBindTo, TypeOfProperty>> property_to_bind_to)
18        {
19            return binding_for(dto)
20                .bind_to_property(property_to_bind_to)
21                .bound_to_control(control);
22        }
23    }
24}