示例#1
0
        /// <summary>
        /// Get the specific response directory from the <see cref="Response"/> message.
        /// </summary>
        private async Task <string> GetResponseDirectory(string aId)
        {
            string result           = string.Empty;
            string responseFileName = FileNames.ResponseFilePath(aId);

            for (int i = 0; i < 10; i++)
            {
                var response = JsonHelper.FromFile <Response>(responseFileName);

                if (response != null && response.Id == aId)
                {
                    result = response.Directory;
                    FileHelper.DeleteWithLock(responseFileName);

                    break;
                }

                await Task.Delay(1000);
            }

            return(result);
        }