private void Work(RulyCanceler canceler) { while (true) { canceler.ThrowIfCancellationRequested(); try { OtherMethod(canceler); } finally { //cleanup resources } } }
private void OtherMethod(RulyCanceler canceler) { canceler.ThrowIfCancellationRequested(); }