Reuse ProgressRecord in Web Cmdlets#3411
Conversation
00aa24a to
3e69272
Compare
| { | ||
| long totalLength = 0; | ||
| byte[] buffer = new byte[StreamHelper.ChunkSize]; | ||
| ProgressRecord record = new ProgressRecord(StreamHelper.ActivityId, WebCmdletStrings.ReadResponseProgressActivity, StringUtil.Format(WebCmdletStrings.ReadResponseProgressStatus, 0)); |
There was a problem hiding this comment.
StringUtil.Format(WebCmdletStrings.ReadResponseProgressStatus, 0)
This is not necessary here. How about just new ProgressRecord(StreamHelper.ActivityId, WebCmdletStrings.ReadResponseProgressActivity, "statusDescriptionPlaceholder"). Then "statusDescriptionPlaceholder" would be a constant.
There was a problem hiding this comment.
Yes, but we cannot use String.Empty - ProgressRecord don't allow. So if we want a const it may be " " (single space). Is it well?
new ProgressRecord(StreamHelper.ActivityId, WebCmdletStrings.ReadResponseProgressActivity, " ")
or
new ProgressRecord(StreamHelper.ActivityId, WebCmdletStrings.ReadResponseProgressActivity, singleSpace) string static singleSpace = " ";
There was a problem hiding this comment.
How about just using the string statusDescriptionPlaceholder as the placeholder?
Fix #3367