#include "StdAfx.h"
#include "IdleForm.h"
#undef MessageBox
namespace Sunlight
{
IdleForm::IdleForm()
{
}
void IdleForm::Run()
{
try
{
__raise Init(this, new EventArgs());
while (Created)
{
Application::DoEvents();
__raise Idle(this, new EventArgs());
}
}
catch(Exception *e)
{
Close();
System::Diagnostics::Debug::WriteLine(String::Format(S"Exception \"{0}\" occurred in {1}.", e->Message, e->Source));
System::Diagnostics::Debug::WriteLine(String::Format(S"Stack trace: {0}", e->StackTrace));
MessageBox::Show(e->Message, e->Source, MessageBoxButtons::OK, MessageBoxIcon::Error);
}
}
}