コード例 #1
0
        public TestController(ITestView view)
        {
            _view = view;

            _td = new TestDispatcher();

            _td.TestStarted   += _td_TestStarted;
            _td.TestCompleted += _td_TestCompleted;

            _td.StepStarted   += _td_StepStarted;
            _td.StepCompleted += _td_StepCompleted;

            _td.RequestSent      += _td_RequestSent;
            _td.ResponseReceived += _td_ResponseReceived;

            _td.OnException += _td_OnException;
            _td.StepEvent   += _td_StepEvent;
            _td.TestEvent   += _td_TestEvent;

            _td.TestSuiteCompleted += new Action <TestSuiteParameters, bool>(_td_TestSuiteCompleted);

            string address = System.Configuration.ConfigurationManager.AppSettings["DutManagementAddress"];

            System.ServiceModel.BasicHttpBinding binding         = new System.ServiceModel.BasicHttpBinding();
            System.ServiceModel.EndpointAddress  endpointAddress = new System.ServiceModel.EndpointAddress(address);
            _dutClient = new AutomatedTesting.DutManagement.DutManagementService.TestSoapClient(binding, endpointAddress);
        }
コード例 #2
0
        private void EnterPasswordView_CheckPasswordEvent(object arg1, EventArgs arg2)
        {
            if (enterPasswordView.Password == model.LoadedTest.Password)
            {
                enterPasswordView.Close();
                testView = new TestView(CloseApplicationEvent, TestView_LoadQuestionEvent, TestView_ChangeAnswerEvent, TestView_ShowResultEvent);

                model.UserAnswers = new List <UserAnswer>();
                for (int i = 0; i < model.LoadedTest.Questions.Count; i++)
                {
                    model.UserAnswers.Add(new UserAnswer());
                }

                testView.QuestionsNumber = model.LoadedTest.Questions.Count;
                testView.loadQuestion(model.LoadedTest.Questions[0], model.UserAnswers[0]);
                testView.Minute = model.LoadedTest.Time;

                informationsView.Hide();
                testView.Start();
            }
            else
            {
                MessageBox.Show("Wrong password");
                enterPasswordView.clearPassword();
            }
        }
コード例 #3
0
 public TestPresenter(ITestView testView)
 {
     this.testView         = testView;
     testModel             = new TestModel();
     testView.SearchClick += LoadSearchResultGrid;
     testView.ClearClick  += LoadAllTestGrids;
     testView.LoadForm    += LoadAllTestGrids;
 }
コード例 #4
0
        public Services(IAcceptsOneControl viewFrame)
        {
            EventBus = new SimpleEventBus();
            IPresenterMapper presenterMapper = new PresenterMapper(this);

            PlaceController = new PlaceController(EventBus, presenterMapper, viewFrame);

            TestView = new TestView();
        }
コード例 #5
0
        public TestPresenter(Test test, ITestView view, TestMode[] modes, ITestHeaderViewModel header)
        {
            _test   = test;
            _view   = view;
            _header = header;

            modes.Each(m => _modes.Add(m.Mode, new ModeCommand(m, this, test, view)));

            _currentMode = _modes[Mode.Preview];
        }
コード例 #6
0
ファイル: ModeCommand.cs プロジェクト: larsw/storyteller
 public ModeCommand(TestMode mode, TestPresenter presenter, Test test, ITestView view)
     : base(() =>
 {
     presenter.EnableMode(mode);
     mode.Refresh();
     view.PlaceInMainPane(mode.ContentView);
 })
 {
     _test = test;
     _mode = mode;
 }
コード例 #7
0
ファイル: ModeCommand.cs プロジェクト: adymitruk/storyteller
 public ModeCommand(TestMode mode, TestPresenter presenter, Test test, ITestView view)
     : base(() =>
     {
         presenter.EnableMode(mode);
         mode.Refresh();
         view.PlaceInMainPane(mode.ContentView);
     })
 {
     _test = test;
     _mode = mode;
 }
コード例 #8
0
        public TestScreen(ITestPresenter presenter, ITestView view, Test test, ITestStateManager stateManager, ITestScreenCloser closer, IEditTestController controller, IOutlineController outline)
        {
            _presenter    = presenter;
            _view         = view;
            _test         = test;
            _stateManager = stateManager;
            _closer       = closer;
            _controller   = controller;
            _outline      = outline;

            _stateManager.RegisterListener(_presenter);
        }
コード例 #9
0
 public TestPresenter(ITestView win, int userId, TestsModel test)
 {
     window      = win;
     model       = test;
     this.userId = userId;
     border      = new BorderPresenter(win);
     window.SetAllQuestions(model.Questions);
     count = 0;
     SetData();
     answers = new Dictionary <int, string>();
     window.Border_MouseLeftButtonDown     += window_Border_MouseLeftButtonDown;
     window.NextBorder_MouseLeftButtonDown += window_NextBorder_MouseLeftButtonDown;
 }
コード例 #10
0
        /// <summary>
        /// Attach the model to the view.
        /// </summary>
        /// <param name="model">The model object</param>
        /// <param name="view">The view used</param>
        /// <param name="explorerPresenter">The explorer presenter</param>
        public void Attach(object model, object view, ExplorerPresenter explorerPresenter)
        {
            this.view              = view as ITestView;
            this.tests             = model as Tests;
            this.explorerPresenter = explorerPresenter;

            this.dataStore = Apsim.Find(this.tests, typeof(DataStore)) as DataStore;
            this.view.Editor.IntelliSenseChars   = " :";
            this.view.Editor.ContextItemsNeeded += this.OnContextItemsNeeded;
            this.view.TableNameChanged          += this.OnTableNameChanged;

            this.PopulateView();
            this.explorerPresenter.CommandHistory.ModelChanged += this.OnModelChanged;
        }
コード例 #11
0
ファイル: TestPresenter.cs プロジェクト: kiwiroy/ApsimX
        /// <summary>
        /// Attach the model to the view.
        /// </summary>
        /// <param name="model">The model object</param>
        /// <param name="view">The view used</param>
        /// <param name="explorerPresenter">The explorer presenter</param>
        public void Attach(object model, object view, ExplorerPresenter explorerPresenter)
        {
            this.view = view as ITestView;
            this.tests = model as Tests;
            this.explorerPresenter = explorerPresenter;

            this.dataStore = Apsim.Find(this.tests, typeof(DataStore)) as DataStore;
            this.view.Editor.IntelliSenseChars = " :";
            this.view.Editor.ContextItemsNeeded += this.OnContextItemsNeeded;
            this.view.TableNameChanged += this.OnTableNameChanged;

            this.PopulateView();
            this.explorerPresenter.CommandHistory.ModelChanged += this.OnModelChanged;
        }
コード例 #12
0
 public TestPresenter(ITestView view)
 {
     this.view  = view;
     view.Load += View_Load;
 }
コード例 #13
0
 public MainPresenter(ITestView view)
 {
     this.view           = view;
     this.view.Presenter = this;
     AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
 }
コード例 #14
0
 public TestPresenter(ITestView view)
 {
     _view.OnSomeEvent += new EventHandler(_view_OnSomeEvent);
 }
コード例 #15
0
ファイル: TestPresenter.cs プロジェクト: marektihkan/Arc
 public TestPresenter(ITestView view)
 {
     View = view;
 }
コード例 #16
0
 public TestController( ITestView view )
     : base(view)
 {
 }