Пример #1
0
        public void Initialize(RandomizationProcessViewModel model)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }

            Model = model;

            InitializeComponent();

            imgLoader.DataBindings.Add("Visible", Model, "SpinnerImageVisible", false, DataSourceUpdateMode.OnPropertyChanged);

            lblInfo.DataBindings.Add("Text", Model, "InfoText", false, DataSourceUpdateMode.OnPropertyChanged);
            lblInfo.DataBindings.Add("Visible", Model, "InfoVisible", false, DataSourceUpdateMode.OnPropertyChanged);

            btnStopRandomizationProcess.Location = new Point(300, 159);
            btnStopRandomizationProcess.DataBindings.Add("Text", Model, "StopProcessButtonText", false, DataSourceUpdateMode.OnPropertyChanged);
            btnStopRandomizationProcess.DataBindings.Add("Enabled", Model, "StopProcessButtonEnabled", false, DataSourceUpdateMode.OnPropertyChanged);
            btnStopRandomizationProcess.DataBindings.Add("Visible", Model, "StopProcessButtonVisible", false, DataSourceUpdateMode.OnPropertyChanged);
            btnStopRandomizationProcess.Click += delegate { Invoke(OnRandomizationStopped); };

            btnGoToPreviousStep.Location = new Point(300, 159);
            btnGoToPreviousStep.DataBindings.Add("Text", Model, "GoToPreviousStepButtonText", false, DataSourceUpdateMode.OnPropertyChanged);
            btnGoToPreviousStep.DataBindings.Add("Visible", Model, "GoToPreviousStepButtonVisible", false, DataSourceUpdateMode.OnPropertyChanged);
            btnGoToPreviousStep.Click += delegate { Invoke(OnRandomizationAborted); };
        }
        public RandomizationProcessPresenter(IApplicationController controller, IRandomizationProcessView view, RandomizationProcessViewModel model, IRandomizerWorker randomizerWorker)
            : base(controller, view)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }
            if (randomizerWorker == null)
            {
                throw new ArgumentNullException("randomizerWorker");
            }

            _model            = model;
            _randomizerWorker = randomizerWorker;
        }