Cheap and Simple.
bool Paused = false;
protected void Pause()
{
while(paused)
{
System.Threading.Thread.Sleep(20);
}
ContinueRecording(timestamp);
}
protected void PauseButton_Click()
{
Paused = !(Paused);
Pause();
}
private void ContinueRecording(DataType timestamp)
{
while(!paused)
{
ContinueRecording(timestamp);
}
}
Like I said... Cheap... very cheap but simple.
Just make sure that you set up the Record method as a recursive function.