void OnFSPollCount(FSPoll fsPoll, FSPollStatus fsPollStatus) { bool checkFailed = false; if (this.callbackCount == 0) { if (fsPollStatus.Error is OperationException error && error.ErrorCode == ErrorCode.ENOENT) { TestHelper.CreateFile(this.file); } else { checkFailed = true; } }
void OnFSPollCount(FSPoll fsPoll, FSPollStatus fsPollStatus) { bool checkFailed = false; if (this.callbackCount == 0) { var error = fsPollStatus.Error as OperationException; if (error != null && error.ErrorCode == ErrorCode.ENOENT) { TestHelper.CreateFile(this.file); } else { checkFailed = true; } } else if (this.callbackCount == 1) { if (fsPollStatus.Error == null) { this.timer.Start(this.OnTimer, 20, 0); } else { checkFailed = true; } } else if (this.callbackCount == 2) { if (fsPollStatus.Error == null) { this.timer.Start(this.OnTimer, 200, 0); } else { checkFailed = true; } } else if (this.callbackCount == 3) { if (fsPollStatus.Error == null) { TestHelper.DeleteFile(this.file); } else { checkFailed = true; } } else if (this.callbackCount == 4) { var error = fsPollStatus.Error as OperationException; if (error != null && error.ErrorCode == ErrorCode.ENOENT) { fsPoll.CloseHandle(this.OnClose); } else { checkFailed = true; } } else { checkFailed = true; } if (checkFailed) { fsPoll.CloseHandle(this.OnClose); this.timer.CloseHandle(this.OnClose); } else { this.callbackCount++; } }
void OnFSPoll(FSPoll fsPoll, FSPollStatus fsPollStatus) => this.callbackCount++;