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>(); }
public AboutForm(IAboutPresenter presenter) { if (presenter == null) { throw new ArgumentNullException("presenter"); } m_Presenter = presenter; m_Presenter.View = this; InitializeComponent(); TranslateUI(); FormClosed += OnFormClosed; }
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>(); }
/// <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); } }
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); }
public AboutForm() { InitializeComponent(); presenter = new AboutPresenter(this); }
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); } }
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; }