예제 #1
0
        public NumericalCalculationsPresenter(INumericalCalculationsView view, IErrorHandler errorHandler)
        {
            _view         = view;
            _errorHandler = errorHandler;
            _view.SetOperations(NumericalMethodsInfo.Instance._methods.Keys.ToArray());
            _view.SelectedOperation = NumericalMethodsInfo.Instance._methods.Keys.First();
            _view.OperationChanged += _view_OperationChanged;

            _view_OperationChanged(null, null);

            EventAggregator.Instance.Subscribe <CalculationsModeChangedEvent>(c => _calculationsMode = c.CalculationsMode);

            SharedViewState.Instance.DefaultActions[ViewName.NumericalCalculations] = _view_ComputeClicked;
            _view.ComputeClicked += _view_ComputeClicked;
        }
예제 #2
0
        public NumericalCalculationsPresenter(INumericalCalculationsView view, IErrorHandler errorHandler, ISharedViewState sharedViewState, IExceptionsHandler exceptionsHandler, ITextProvider expressionTextProvider, ICodeEditorView customFunctionsEditor, IExpressionsEvaluator expressionsEvaluator)
        {
            _view                      = view;
            _errorHandler              = errorHandler;
            _sharedViewState           = sharedViewState;
            _exceptionsHandler         = exceptionsHandler;
            _expressionTextProvider    = expressionTextProvider;
            this.customFunctionsEditor = customFunctionsEditor;
            this.expressionsEvaluator  = expressionsEvaluator;
            _view.SetOperations(NumericalMethodsInfo.Instance._methods.Keys.ToArray());
            _view.SelectedOperation = NumericalMethodsInfo.Instance._methods.Keys.First();
            _view.OperationChanged += _view_OperationChanged;

            _view_OperationChanged(null, null);

            EventAggregator.Instance.Subscribe <CalculationsModeChangedEvent>(c => _calculationsMode = c.CalculationsMode);

            _sharedViewState.DefaultActions[ViewName.NumericalCalculations] = _view_ComputeClicked;
            _view.ComputeClicked += _view_ComputeClicked;
        }