#include "StdAfx.h"
#include "Timer1.h"

using namespace Sianaso;

Timer1::Timer1(CallBack_Sample^ _Sample, double Tvz)//, void (*_funkce)(void))
{
	aTimer = gcnew System::Timers::Timer(Tvz);
	aTimer->Elapsed += gcnew ElapsedEventHandler(this,&Sianaso::Timer1::OnTimedEvent);
	aTimer->Enabled = true;
	Sample = _Sample;
}

Timer1::~Timer1()
{
//	aTimer->Enabled = false;
	delete aTimer;
}

void Timer1::OnTimedEvent(Object^ source, ElapsedEventArgs^ e)
{	
	Sample();
}