コード例 #1
0
        /// <summary>
        /// Called after the view has been created but before it is on display to the user.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!DesignMode)
            {
                Localise.Form(this);

                labelProgressText.Text = "";

                _Presenter             = Factory.Singleton.Resolve <IShutdownPresenter>();
                _Presenter.UPnpManager = _UPnpManager;
                _Presenter.Initialise(this);

                backgroundWorker.RunWorkerAsync();
            }
        }
コード例 #2
0
        public void ShutdownPresenter_ShutdownApplication_Closes_Plugins()
        {
            var plugin1 = new Mock <IPlugin>();
            var plugin2 = new Mock <IPlugin>();

            plugin1.Setup(p => p.Name).Returns("X");
            plugin2.Setup(p => p.Name).Returns("B");

            plugin1.Setup(p => p.Shutdown()).Callback(() => {
                _View.Verify(v => v.ReportProgress(String.Format(Strings.ShuttingDownPlugin, "X")), Times.Once());
            });

            plugin2.Setup(p => p.Shutdown()).Callback(() => {
                _View.Verify(v => v.ReportProgress(String.Format(Strings.ShuttingDownPlugin, "B")), Times.Once());
            });

            _Plugins.Add(plugin1.Object);
            _Plugins.Add(plugin2.Object);

            _Presenter.Initialise(_View.Object);
            _Presenter.ShutdownApplication();

            plugin1.Verify(p => p.Shutdown(), Times.Once());
            plugin2.Verify(p => p.Shutdown(), Times.Once());
        }
コード例 #3
0
        /// <summary>
        /// Called after the view has been created but before it is on display to the user.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if(!DesignMode) {
                Localise.Form(this);

                labelProgressText.Text = "";

                _Presenter = Factory.Singleton.Resolve<IShutdownPresenter>();
                _Presenter.BaseStationAircraftList = _BaseStationAircraftList;
                _Presenter.UPnpManager = _UPnpManager;
                _Presenter.Initialise(this);

                backgroundWorker.RunWorkerAsync();
            }
        }