#region License
/**
* Ingenious MVC : An MVC framework for .NET 2.0
* Copyright (C) 2006, JDP Group
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Authors: - Kent Boogaart (kentcb@internode.on.net)
*/
#endregion
using System;
using Ingenious.Mvc.Navigators;
using Ingenious.Mvc.Util;
using Ingenious.Mvc.Windows.Forms.ViewManagers;
namespace Ingenious.Mvc.Windows.Forms.Views{
/// <include file='WizardUserControlBase.doc.xml' path='/doc/member[@name="T:WizardUserControlBase"]/*'/>
public class WizardUserControlBase : UserControlBase, IWizardUserControlView
{
private bool _canDoPrevious;
private bool _canDoNext;
private bool _canCancel;
/// <include file='WizardUserControlBase.doc.xml' path='/doc/member[@name="P:CanDoPrevious"]/*'/>
public bool CanDoPrevious
{
get
{
return _canDoPrevious;
}
set
{
if (value != _canDoPrevious)
{
_canDoPrevious = value;
OnChanged();
}
}
}
/// <include file='WizardUserControlBase.doc.xml' path='/doc/member[@name="P:CanDoNext"]/*'/>
public bool CanDoNext
{
get
{
return _canDoNext;
}
set
{
if (value != _canDoNext)
{
_canDoNext = value;
OnChanged();
}
}
}
/// <include file='WizardUserControlBase.doc.xml' path='/doc/member[@name="P:CanCancel"]/*'/>
public bool CanCancel
{
get
{
return _canCancel;
}
set
{
if (value != _canCancel)
{
_canCancel = value;
OnChanged();
}
}
}
/// <include file='WizardUserControlBase.doc.xml' path='/doc/member[@name="E:Changed"]/*'/>
public event EventHandler<EventArgs> Changed;
/// <include file='WizardUserControlBase.doc.xml' path='/doc/member[@name="M:.ctor()"]/*'/>
public WizardUserControlBase()
{
_canDoPrevious = true;
_canDoNext = true;
_canCancel = true;
}
/// <include file='WizardUserControlBase.doc.xml' path='/doc/member[@name="M:GetPreviousViewAliasId()"]/*'/>
public virtual Id<IView> GetPreviousViewAliasId()
{
return WizardNavigator.PreviousViewAliasId;
}
/// <include file='WizardUserControlBase.doc.xml' path='/doc/member[@name="M:GetNextViewAliasId()"]/*'/>
public virtual Id<IView> GetNextViewAliasId()
{
return WizardNavigator.NextViewAliasId;
}
/// <include file='WizardUserControlBase.doc.xml' path='/doc/member[@name="M:BeforeDoPrevious()"]/*'/>
public virtual bool BeforeDoPrevious()
{
//default implementation does nothing
return true;
}
/// <include file='WizardUserControlBase.doc.xml' path='/doc/member[@name="M:BeforeDoNext()"]/*'/>
public virtual bool BeforeDoNext()
{
//default implementation does nothing
return true;
}
/// <include file='WizardUserControlBase.doc.xml' path='/doc/member[@name="M:BeforeCancel()"]/*'/>
public virtual bool BeforeCancel()
{
//default implementation does nothing
return true;
}
/// <include file='WizardUserControlBase.doc.xml' path='/doc/member[@name="M:OnChanged()"]/*'/>
protected virtual void OnChanged()
{
//translate into generic Changed event
EventHelper.Raise(Changed, this, EventArgs.Empty);
}
}
}
|