|
//----------------------------------------------------------------------------------------
// 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.scsf.2006jun/SCSF/html/03-030-Model%20View%20Presenter%20%20MVP%20.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 Matias.Infrastructure.Interface;
using Microsoft.Practices.CompositeUI.EventBroker;
using Matias.Infrastructure.Interface.Constants;
namespace Matias.ContactsModule
{
public class ContactViewLeftPresenter : Presenter<IContactViewLeft>
{
/// <summary>
/// This method is a placeholder that will be called by the view when it's been loaded <see cref="System.Winforms.Control.OnLoad"/>
/// </summary>
public override void OnViewReady()
{
base.OnViewReady();
}
/// <summary>
/// Close the view
/// </summary>
public void OnCloseView()
{
base.CloseView();
}
[EventPublication(EventTopicNames.ChangeColor,PublicationScope.Global)]
public event EventHandler<EventArgs> ChangeColor;
public void ChangeViewColor()
{
Random random = new Random();
int r = random.Next(256);
int g = random.Next(256);
int b = random.Next(256);
System.Drawing.Color color = System.Drawing.Color.FromArgb(r, g, b);
if (ChangeColor != null)
{
ChangeColor(this, new EventArgs<System.Drawing.Color>(color));
}
}
}
}
|
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.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.