Esempio n. 1
0
        public DialogResult ShowView()
        {
            _Presenter = Factory.Singleton.Resolve <IAboutPresenter>();
            _Presenter.Initialise(this);

            return(DialogResult.OK);
        }
        public void TestInitialise()
        {
            _OriginalFactory = Factory.TakeSnapshot();

            _View = new Mock<IAboutView>() { DefaultValue = DefaultValue.Mock }.SetupAllProperties();
            _ApplicationInformation = TestUtilities.CreateMockImplementation<IApplicationInformation>();
            _ConfigurationStorage = TestUtilities.CreateMockSingleton<IConfigurationStorage>();
            _RuntimeEnvironment = TestUtilities.CreateMockSingleton<IRuntimeEnvironment>();

            _Presenter = Factory.Singleton.Resolve<IAboutPresenter>();
        }
Esempio n. 3
0
 public AboutForm(IAboutPresenter presenter)
 {
     if (presenter == null)
     {
         throw new ArgumentNullException("presenter");
     }
     m_Presenter      = presenter;
     m_Presenter.View = this;
     InitializeComponent();
     TranslateUI();
     FormClosed += OnFormClosed;
 }
Esempio n. 4
0
        public void TestInitialise()
        {
            _OriginalFactory = Factory.TakeSnapshot();

            _View = new Mock <IAboutView>()
            {
                DefaultValue = DefaultValue.Mock
            }.SetupAllProperties();
            _ApplicationInformation = TestUtilities.CreateMockImplementation <IApplicationInformation>();
            _ConfigurationStorage   = TestUtilities.CreateMockSingleton <IConfigurationStorage>();
            _RuntimeEnvironment     = TestUtilities.CreateMockSingleton <IRuntimeEnvironment>();

            _Presenter = Factory.Resolve <IAboutPresenter>();
        }
Esempio n. 5
0
        /// <summary>
        /// Called when the form has been created but before it is on display.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!DesignMode)
            {
                Localise.Form(this);
                logoPictureBox.Image = Resources.Images.HelpAbout;

                _Presenter = Factory.Singleton.Resolve <IAboutPresenter>();
                _Presenter.Initialise(this);

                _OnlineHelp = new OnlineHelpHelper(this, OnlineHelpAddress.WinFormsAboutDialog);
            }
        }
Esempio n. 6
0
 public virtual void BindAboutView(IAboutView view)
 {
     _aboutView = view;
     _aboutView.OnViewDestroy = (view2) =>
     {
         _aboutPresenter.ViewDestroyed();
         _aboutPresenter = null;
         _aboutView = null;
     };
     _aboutPresenter = Bootstrapper.GetContainer().Resolve<IAboutPresenter>();
     _aboutPresenter.BindView(view);
 }
Esempio n. 7
0
		public AboutForm()
		{
			InitializeComponent();
			presenter = new AboutPresenter(this);
		}
Esempio n. 8
0
 public void AttachPresenter(IAboutPresenter presenter)
 {
     _presenter = presenter;
 }
        /// <summary>
        /// Called when the form has been created but before it is on display.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if(!DesignMode) {
                Localise.Form(this);
                logoPictureBox.Image = Resources.Images.HelpAbout;

                _Presenter = Factory.Singleton.Resolve<IAboutPresenter>();
                _Presenter.Initialise(this);

                _OnlineHelp = new OnlineHelpHelper(this, OnlineHelpAddress.WinFormsAboutDialog);
            }
        }
Esempio n. 10
0
        public virtual IAboutView CreateAboutView()
        {
            // If the view is still visible, just make it the top level window
            if (_aboutView != null)
            {
                _aboutView.ShowView(true);
                return _aboutView;
            }

            // The view invokes the OnViewReady action when the view is ready. This means the presenter can be created and bound to the view.
            Action<IBaseView> onViewReady = (view) =>
            {
                _aboutPresenter = Bootstrapper.GetContainer().Resolve<IAboutPresenter>();
                _aboutPresenter.BindView((IAboutView)view);
            };

            // Create view and manage view destruction
            _aboutView = Bootstrapper.GetContainer().Resolve<IAboutView>(new NamedParameterOverloads() { { "onViewReady", onViewReady } });
            _aboutView.OnViewDestroy = (view) =>
            {
                _aboutPresenter.ViewDestroyed();
                _aboutPresenter = null;
                _aboutView = null;
            };
            return _aboutView;
        }