コード例 #1
0
 internal BinderController(Binder binder, IBinderModel model)
 {
     _binder = binder;
     _views = new List<BinderViewBase>();
     _model = model;
     _model.Controller = this;
 }
コード例 #2
0
ファイル: PasteUpForm.cs プロジェクト: gregorypilar/interlace
        public PasteUpForm()
        {
            InitializeComponent();

            _pasteUp = new PasteUpControl();
            _pasteUp.Parent = this;
            _pasteUp.Dock = DockStyle.Fill;
            _pasteUp.MouseDown += new MouseEventHandler(_pasteUp_MouseDown);

            Binder formBinder = new Binder(this);
            Binder controlBinder = new Binder(formBinder, "PasteUpControl");
            controlBinder.AddBinding("Text", new PropertyView(this, "Text", "Unknown"));
        }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: gregorypilar/interlace
        private void MainForm_Load(object sender, EventArgs e)
        {
            _mainFormBinder = new Binder(this);
            _selectedFormBinder = new Binder(_mainFormBinder, "SelectedForm");
            _selectedPasteUpBinder = new Binder(_selectedFormBinder, "PasteUpControl");

            PanelPerTypeView panelPerTypeView = new PanelPerTypeView();
            panelPerTypeView.NullPanel = _noPropertiesPanel;
            panelPerTypeView.AddPanel(typeof(LabelDocumentFrame), _labelPropertiesPanel);
            _selectedPasteUpBinder.AddBinding("SelectedFrame", panelPerTypeView);

            Binder labelPropertiesBinder = new Binder();
            _selectedPasteUpBinder.AddBinding("SelectedFrame", new PropertyView(labelPropertiesBinder, "BoundTo", null, true),
                new TypeFilterConverter<LabelDocumentFrame>());

            labelPropertiesBinder.AddBinding("Label", new BaseEditBinderView(_labelLabel));
            labelPropertiesBinder.AddBinding("Caption", new BaseEditBinderView(_labelCaption));

            MdiChildActivate += new EventHandler(MainForm_MdiChildActivate);
        }
コード例 #4
0
ファイル: Binder.cs プロジェクト: gregorypilar/interlace
 /// <summary>
 /// Initializes a new instance of the <see cref="Binder"/> class, and creates 
 /// a binding on an underlying binder to update this binders BoundTo property.
 /// </summary>
 /// <param name="boundToBinder">The binder to create the binding on.</param>
 /// <param name="propertyName">Name of the property to bind to.</param>
 /// <param name="readOnly">A boolean indicating whether the binding should be bidirectional or read only.</param>
 public Binder(Binder boundToBinder, string propertyName, bool readOnly)
     : this()
 {
     boundToBinder.AddBinding(propertyName, new PropertyView(this, "BoundTo", null, readOnly));
 }