Exemplo n.º 1
0
        public override void InitializeBinding()
        {
            base.InitializeBinding();
            _excelSheetSelectionScreenBinder.Bind(x => x.FilePath)
            .To(filePathButtonEdit);

            _excelSheetSelectionScreenBinder.Bind(x => x.SelectedSheet)
            .To(_sheetNameComboBox)
            .WithValues(x => x.AllSheetNames);

            _excelSheetSelectionScreenBinder.Bind(x => x.Messages)
            .To(messageMemoEdit);

            _excelSheetSelectionScreenBinder.Bind(x => x.SelectedSheet)
            .ToEnableOf(btnExtra)
            .EnabledWhen(x => !string.IsNullOrEmpty(x));

            _importStartValuesDTOScreenBinder.Bind(x => x.Count)
            .ToEnableOf(btnOk)
            .EnabledWhen(count => count > 0);

            btnExtra.InitWithImage(ApplicationIcons.Run, AppConstants.Captions.StartImport);
            btnExtra.Click += (o, e) => OnEvent(() => _presenter.StartImport());
            ExtraVisible    = true;

            filePathButtonEdit.Click += (o, e) => OnEvent(() => _presenter.SelectFile());

            btnOk.Click += (o, e) => OnEvent(() => _presenter.TransferImportedQuantities());
            btnOk.Text   = AppConstants.Captions.Transfer;
        }
 protected override void OkClicked()
 {
     base.OkClicked();
     _presenter.TransferImportedQuantities();
 }