Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Windows.Forms/Commands
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv909/src/Adapdev.Windows.Forms/Commands
Added Files:
AbstractGUICommand.cs IGUICommand.cs
ShowErrorMessageCommand.cs vssver.scc
Log Message:
--- NEW FILE: AbstractGUICommand.cs ---
using System;
using Adapdev.Commands;
namespace Adapdev.Windows.Commands
{
using System.Windows.Forms;
/// <summary>
/// Summary description for AbstractGUICommand.
/// </summary>
public abstract class AbstractGUICommand : IGUICommand
{
private IWin32Window _owner = null;
public AbstractGUICommand(IWin32Window owner)
{
this._owner = owner;
}
public IWin32Window Owner
{
get
{
return this._owner;
}
set
{
this._owner = value;
}
}
public abstract void Execute();
}
}
--- NEW FILE: IGUICommand.cs ---
using System;
using System.Windows.Forms;
using Adapdev.Commands;
namespace Adapdev.Windows.Commands
{
/// <summary>
/// Summary description for IGUICommand.
/// </summary>
public interface IGUICommand : ICommand
{
IWin32Window Owner{get;set;}
}
}
--- NEW FILE: vssver.scc ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: ShowErrorMessageCommand.cs ---
using System;
using Adapdev.Commands;
namespace Adapdev.Windows.Commands
{
using System.Windows.Forms;
/// <summary>
/// Summary description for MessageBoxCommand.
/// </summary>
public class ShowErrorMessageCommand : AbstractGUICommand
{
private Exception _exception = null;
private bool _showStackTrace = false;
private DialogResult _result;
public ShowErrorMessageCommand(IWin32Window owner, Exception e, bool showStackTrace):base(owner)
{
this._exception = e;
this._showStackTrace = showStackTrace;
}
public override void Execute()
{
this._result = MessageBox.Show(this.GetMessage(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
private string GetMessage()
{
if(this._showStackTrace)
{
return this._exception.Message + " : " + this._exception.StackTrace;
}
else
{
return this._exception.Message;
}
}
public DialogResult Result
{
get{return this._result;}
}
}
}
|