|
//----------------------------------------------------------------------------------------
// patterns & practices - Smart Client Software Factory - Guidance Package
//
// This file was generated by the "Add View" recipe.
//
// A presenter calls methods of a view to update the information that the view displays.
// The view exposes its methods through an interface definition, and the presenter contains
// a reference to the view interface. This allows you to test the presenter with different
// implementations of a view (for example, a mock view).
//
// For more information see:
// ms-help://MS.VSCC.v80/MS.VSIPCC.v80/ms.practices.scsf.2007may/SCSF/html/02-09-010-ModelViewPresenter_MVP.htm
//
// Latest version of this Guidance Package: http://go.microsoft.com/fwlink/?LinkId=62182
//----------------------------------------------------------------------------------------
using System;
using Microsoft.Practices.ObjectBuilder;
using Microsoft.Practices.CompositeUI;
using DialogBox.Infrastructure.Interface;
using DialogBox.Module1.Constants;
using System.Windows.Forms;
namespace DialogBox.Module1
{
public partial class View1Presenter : Presenter<IView1>
{
private DialogView _dialog;
[InjectionConstructor]
public View1Presenter(
[Dependency(Name = UIExtensionSiteNames.Dialog, NotPresentBehavior = NotPresentBehavior.CreateNew)] DialogView dialog)
{
_dialog = dialog;
}
/// <summary>
/// This method is a placeholder that will be called by the view when it has been loaded.
/// </summary>
public override void OnViewReady()
{
base.OnViewReady();
}
/// <summary>
/// Close the view
/// </summary>
public void OnCloseView()
{
base.CloseView();
}
internal void ShowDialog()
{
WorkItem.Workspaces[WorkspaceNames.DialogBoxWorkspace].Show(_dialog);
if (_dialog.DialogResult == DialogResult.OK)
{
MessageBox.Show("Do something");
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Program Manager in Sculpture project, Interesting in .NET Model driven development.