Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Reuse ProgressRecord in Web Cmdlets#3411

Merged
daxian-dbw merged 2 commits into
PowerShell:masterPowerShell/PowerShell:masterfrom
iSazonov:recordprogressiSazonov/PowerShell:recordprogressCopy head branch name to clipboard
Mar 28, 2017
Merged

Reuse ProgressRecord in Web Cmdlets#3411
daxian-dbw merged 2 commits into
PowerShell:masterPowerShell/PowerShell:masterfrom
iSazonov:recordprogressiSazonov/PowerShell:recordprogressCopy head branch name to clipboard

Conversation

@iSazonov

Copy link
Copy Markdown
Collaborator

Fix #3367

@iSazonov iSazonov added the Review - Needed The PR is being reviewed label Mar 24, 2017
{
long totalLength = 0;
byte[] buffer = new byte[StreamHelper.ChunkSize];
ProgressRecord record = new ProgressRecord(StreamHelper.ActivityId, WebCmdletStrings.ReadResponseProgressActivity, StringUtil.Format(WebCmdletStrings.ReadResponseProgressStatus, 0));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 = " ";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about just using the string statusDescriptionPlaceholder as the placeholder?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@daxian-dbw daxian-dbw self-assigned this Mar 24, 2017
@daxian-dbw daxian-dbw merged commit b212c7a into PowerShell:master Mar 28, 2017
@iSazonov iSazonov deleted the recordprogress branch March 29, 2017 05:55
@iSazonov iSazonov removed the Review - Needed The PR is being reviewed label Mar 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.