Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 5.6k
Backport XML docs for System.Diagnostics.FileVersionInfo from dotnet-api-docs#124405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
cd3614b
Initial plan
Copilot df1e9ba
Add XML documentation to FileVersionInfo and enable compiler-generate…
Copilot 10a2a2d
Fix documentation for int properties - use 0 instead of null
Copilot 454d259
Improve ToString documentation in ref assembly to match source
Copilot 3b9204a
Improve GetVersionInfo documentation in ref assembly to match source
Copilot a640b63
Remove XML docs from ref assembly per feedback
Copilot 854b40d
use compiler-generated xml docs file
gewarren d2f2626
Merge branch 'main' of github.com:dotnet/runtime into copilot/backpor…
gewarren 12c67c8
Apply suggestions from code review
gewarren 3a96abe
Update src/libraries/System.Diagnostics.FileVersionInfo/src/System/Di…
gewarren e0d06f7
Apply suggestions from code review
gewarren File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
1 change: 0 additions & 1 deletion
1 ...ibraries/System.Diagnostics.FileVersionInfo/src/System.Diagnostics.FileVersionInfo.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 35 additions & 8 deletions
43 src/libraries/System.Diagnostics.FileVersionInfo/src/System/Diagnostics/FileVersionInfo.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -43,6 +43,7 @@ public sealed partial class FileVersionInfo | ||
| /// <summary> | ||
| /// Gets the comments associated with the file. | ||
| /// </summary> | ||
| /// <value>The comments associated with the file or <see langword="null"/> if the file did not contain version information.</value> | ||
| public string? Comments | ||
| { | ||
| get { return _comments; } | ||
| @@ -51,6 +52,7 @@ public string? Comments | ||
| /// <summary> | ||
| /// Gets the name of the company that produced the file. | ||
| /// </summary> | ||
| /// <value>The name of the company that produced the file or <see langword="null"/> if the file did not contain version information.</value> | ||
| public string? CompanyName | ||
| { | ||
| get { return _companyName; } | ||
| @@ -59,6 +61,7 @@ public string? CompanyName | ||
| /// <summary> | ||
| /// Gets the build number of the file. | ||
| /// </summary> | ||
| /// <value>A value representing the build number of the file or 0 (zero) if the file did not contain version information.</value> | ||
| public int FileBuildPart | ||
| { | ||
| get { return _fileBuild; } | ||
| @@ -67,6 +70,7 @@ public int FileBuildPart | ||
| /// <summary> | ||
| /// Gets the description of the file. | ||
| /// </summary> | ||
| /// <value>The description of the file or <see langword="null"/> if the file did not contain version information.</value> | ||
| public string? FileDescription | ||
| { | ||
| get { return _fileDescription; } | ||
| @@ -75,6 +79,7 @@ public string? FileDescription | ||
| /// <summary> | ||
| /// Gets the major part of the version number. | ||
| /// </summary> | ||
| /// <value>A value representing the major part of the version number or 0 (zero) if the file did not contain version information.</value> | ||
| public int FileMajorPart | ||
| { | ||
| get { return _fileMajor; } | ||
| @@ -83,6 +88,7 @@ public int FileMajorPart | ||
| /// <summary> | ||
| /// Gets the minor part of the version number of the file. | ||
| /// </summary> | ||
| /// <value>A value representing the minor part of the version number of the file or 0 (zero) if the file did not contain version information.</value> | ||
| public int FileMinorPart | ||
| { | ||
| get { return _fileMinor; } | ||
| @@ -91,6 +97,7 @@ public int FileMinorPart | ||
| /// <summary> | ||
| /// Gets the name of the file that this instance of <see cref="FileVersionInfo" /> describes. | ||
| /// </summary> | ||
| /// <value>The name of the file described by this instance of <see cref="FileVersionInfo" />.</value> | ||
| public string FileName | ||
| { | ||
| get { return _fileName; } | ||
| @@ -99,6 +106,7 @@ public string FileName | ||
| /// <summary> | ||
| /// Gets the file private part number. | ||
| /// </summary> | ||
| /// <value>A value representing the file private part number or 0 (zero) if the file did not contain version information.</value> | ||
| public int FilePrivatePart | ||
| { | ||
| get { return _filePrivate; } | ||
| @@ -107,6 +115,7 @@ public int FilePrivatePart | ||
| /// <summary> | ||
| /// Gets the file version number. | ||
| /// </summary> | ||
| /// <value>The version number of the file or <see langword="null"/> if the file did not contain version information.</value> | ||
| public string? FileVersion | ||
| { | ||
| get { return _fileVersion; } | ||
| @@ -115,24 +124,25 @@ public string? FileVersion | ||
| /// <summary> | ||
| /// Gets the internal name of the file, if one exists. | ||
| /// </summary> | ||
| /// <value>The internal name of the file. If none exists, this property will contain the original name of the file without the extension.</value> | ||
| public string? InternalName | ||
| { | ||
| get { return _internalName; } | ||
| } | ||
| /// <summary> | ||
| /// Gets a value that specifies whether the file contains debugging information | ||
| /// or is compiled with debugging features enabled. | ||
| /// Gets a value that specifies whether the file contains debugging information or is compiled with debugging features enabled. | ||
| /// </summary> | ||
| /// <value><see langword="true"/> if the file contains debugging information or is compiled with debugging features enabled; otherwise, <see langword="false"/>.</value> | ||
| public bool IsDebug | ||
| { | ||
| get { return _isDebug; } | ||
| } | ||
| /// <summary> | ||
| /// Gets a value that specifies whether the file has been modified and is not identical to | ||
| /// the original shipping file of the same version number. | ||
| /// Gets a value that specifies whether the file has been modified and is not identical to the original shipping file of the same version number. | ||
| /// </summary> | ||
| /// <value><see langword="true"/> if the file is patched; otherwise, <see langword="false"/>.</value> | ||
| public bool IsPatched | ||
| { | ||
| get { return _isPatched; } | ||
| @@ -141,15 +151,16 @@ public bool IsPatched | ||
| /// <summary> | ||
| /// Gets a value that specifies whether the file was built using standard release procedures. | ||
| /// </summary> | ||
| /// <value><see langword="true"/> if the file is a private build; <see langword="false"/> if the file was built using standard release procedures or if the file did not contain version information.</value> | ||
| public bool IsPrivateBuild | ||
| { | ||
| get { return _isPrivateBuild; } | ||
| } | ||
| /// <summary> | ||
| /// Gets a value that specifies whether the file | ||
| /// is a development version, rather than a commercially released product. | ||
| /// Gets a value that specifies whether the file is a development version, rather than a commercially released product. | ||
| /// </summary> | ||
| /// <value><see langword="true"/> if the file is prerelease; otherwise, <see langword="false"/>.</value> | ||
| public bool IsPreRelease | ||
| { | ||
| get { return _isPreRelease; } | ||
| @@ -158,6 +169,7 @@ public bool IsPreRelease | ||
| /// <summary> | ||
| /// Gets a value that specifies whether the file is a special build. | ||
| /// </summary> | ||
| /// <value><see langword="true"/> if the file is a special build; otherwise, <see langword="false"/>.</value> | ||
| public bool IsSpecialBuild | ||
| { | ||
| get { return _isSpecialBuild; } | ||
| @@ -166,6 +178,7 @@ public bool IsSpecialBuild | ||
| /// <summary> | ||
| /// Gets the default language string for the version info block. | ||
| /// </summary> | ||
| /// <value>The description string for the Microsoft Language Identifier in the version resource or <see langword="null"/> if the file did not contain version information.</value> | ||
| public string? Language | ||
| { | ||
| get { return _language; } | ||
| @@ -174,6 +187,7 @@ public string? Language | ||
| /// <summary> | ||
| /// Gets all copyright notices that apply to the specified file. | ||
| /// </summary> | ||
| /// <value>The copyright notices that apply to the specified file or <see langword="null"/> if the file did not contain version information.</value> | ||
| public string? LegalCopyright | ||
| { | ||
| get { return _legalCopyright; } | ||
| @@ -182,6 +196,7 @@ public string? LegalCopyright | ||
| /// <summary> | ||
| /// Gets the trademarks and registered trademarks that apply to the file. | ||
| /// </summary> | ||
| /// <value>The trademarks and registered trademarks that apply to the file or <see langword="null"/> if the file did not contain version information.</value> | ||
| public string? LegalTrademarks | ||
| { | ||
| get { return _legalTrademarks; } | ||
| @@ -190,6 +205,7 @@ public string? LegalTrademarks | ||
| /// <summary> | ||
| /// Gets the name the file was created with. | ||
| /// </summary> | ||
| /// <value>The name the file was created with or <see langword="null"/> if the file did not contain version information.</value> | ||
| public string? OriginalFilename | ||
| { | ||
| get { return _originalFilename; } | ||
| @@ -198,6 +214,7 @@ public string? OriginalFilename | ||
| /// <summary> | ||
| /// Gets information about a private version of the file. | ||
| /// </summary> | ||
| /// <value>Information about a private version of the file or <see langword="null"/> if the file did not contain version information.</value> | ||
| public string? PrivateBuild | ||
| { | ||
| get { return _privateBuild; } | ||
| @@ -206,6 +223,7 @@ public string? PrivateBuild | ||
| /// <summary> | ||
| /// Gets the build number of the product this file is associated with. | ||
| /// </summary> | ||
| /// <value>A value representing the build number of the product this file is associated with or 0 (zero) if the file did not contain version information.</value> | ||
| public int ProductBuildPart | ||
| { | ||
| get { return _productBuild; } | ||
| @@ -214,6 +232,7 @@ public int ProductBuildPart | ||
| /// <summary> | ||
| /// Gets the major part of the version number for the product this file is associated with. | ||
| /// </summary> | ||
| /// <value>A value representing the major part of the product version number or 0 (zero) if the file did not contain version information.</value> | ||
| public int ProductMajorPart | ||
| { | ||
| get { return _productMajor; } | ||
| @@ -222,6 +241,7 @@ public int ProductMajorPart | ||
| /// <summary> | ||
| /// Gets the minor part of the version number for the product the file is associated with. | ||
| /// </summary> | ||
| /// <value>A value representing the minor part of the product version number or 0 (zero) if the file did not contain version information.</value> | ||
| public int ProductMinorPart | ||
| { | ||
| get { return _productMinor; } | ||
| @@ -230,6 +250,7 @@ public int ProductMinorPart | ||
| /// <summary> | ||
| /// Gets the name of the product this file is distributed with. | ||
| /// </summary> | ||
| /// <value>The name of the product this file is distributed with or <see langword="null"/> if the file did not contain version information.</value> | ||
| public string? ProductName | ||
| { | ||
| get { return _productName; } | ||
| @@ -238,6 +259,7 @@ public string? ProductName | ||
| /// <summary> | ||
| /// Gets the private part number of the product this file is associated with. | ||
| /// </summary> | ||
| /// <value>A value representing the private part number of the product this file is associated with or 0 (zero) if the file did not contain version information.</value> | ||
| public int ProductPrivatePart | ||
| { | ||
| get { return _productPrivate; } | ||
| @@ -246,6 +268,7 @@ public int ProductPrivatePart | ||
| /// <summary> | ||
| /// Gets the version of the product this file is distributed with. | ||
| /// </summary> | ||
| /// <value>The version of the product this file is distributed with or <see langword="null"/> if the file did not contain version information.</value> | ||
| public string? ProductVersion | ||
| { | ||
| get { return _productVersion; } | ||
| @@ -254,6 +277,7 @@ public string? ProductVersion | ||
| /// <summary> | ||
| /// Gets the special build information for the file. | ||
| /// </summary> | ||
| /// <value>The special build information for the file or <see langword="null"/> if the file did not contain version information.</value> | ||
| public string? SpecialBuild | ||
| { | ||
| get { return _specialBuild; } | ||
| @@ -262,6 +286,9 @@ public string? SpecialBuild | ||
| /// <summary> | ||
| /// Returns a <see cref="FileVersionInfo" /> representing the version information associated with the specified file. | ||
| /// </summary> | ||
| /// <param name="fileName">The path and name of the file to retrieve version information for.</param> | ||
| /// <returns>A <see cref="FileVersionInfo" /> containing information about the file. If the file did not contain version information, the <see cref="FileVersionInfo" /> contains only the name of the file requested.</returns> | ||
gewarren marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| /// <exception cref="FileNotFoundException"><paramref name="fileName"/> does not exist or cannot be accessed.</exception> | ||
| public static FileVersionInfo GetVersionInfo(string fileName) | ||
| { | ||
| // Check if fileName is a full path. Relative paths can cause confusion if the local file has the .dll extension, | ||
| @@ -280,9 +307,9 @@ public static FileVersionInfo GetVersionInfo(string fileName) | ||
| } | ||
| /// <summary> | ||
| /// Returns a partial list of properties in <see cref="FileVersionInfo" /> | ||
| /// and their values. | ||
| /// Returns a partial list of properties in the <see cref="FileVersionInfo" /> and their values. | ||
| /// </summary> | ||
| /// <returns>A list of the following properties in this class and their values: <see cref="FileName" />, <see cref="InternalName" />, <see cref="OriginalFilename" />, <see cref="FileVersion" />, <see cref="FileDescription" />, <see cref="ProductName" />, <see cref="ProductVersion" />, <see cref="IsDebug" />, <see cref="IsPatched" />, <see cref="IsPreRelease" />, <see cref="IsPrivateBuild" />, <see cref="IsSpecialBuild" />, <see cref="Language" />. If the file did not contain version information, <see cref="FileName" /> will still contain the name of the file requested, Boolean values will be <see langword="false" />, and the other version-related values will be empty.</returns> | ||
| public override string ToString() | ||
| { | ||
| // An initial capacity of 512 was chosen because it is large enough to cover | ||
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.