public Task <ReturnMessage> StopRecord() { Task <ReturnMessage> checkTask = _meetingManager.CheckMeetingServerStatus(); if (checkTask != null) { return(checkTask); } var tcs = new TaskCallback <ReturnMessage>("StopRecord"); if (_meetingManager.TaskCallbacks.ContainsKey(tcs.Name)) { _meetingManager.TaskCallbacks.Remove(tcs.Name); } _meetingManager.TaskCallbacks.Add(tcs.Name, tcs); var result = MeetingAgent.StopRecord(); if (result != 0) { return(Task.FromResult(MessageManager.FailedToStopRecord)); } return(tcs.Task); }