fix #647 make ProcessVersions Entity a record to ensure readonly access to props

This is to address a PR #648 review comment to ensure that only the external
users are not able to modify the instance values.
This commit is contained in:
Todd Schavey
2022-01-04 12:11:52 -05:00
committed by lucas
parent 8daf4d1498
commit f9601a6e3e
3 changed files with 12 additions and 20 deletions

View File

@@ -0,0 +1,10 @@
namespace ElectronNET.API
{
/// <summary>
/// An object listing the version strings specific to Electron
/// </summary>
/// <param name="Chrome">Value representing Chrome's version string</param>
/// <param name="Electron">Value representing Electron's version string</param>
/// <returns></returns>
public record ProcessVersions(string Chrome, string Electron);
}

View File

@@ -1,18 +0,0 @@
namespace ElectronNET.API
{
/// <summary>
///
/// </summary>
public class Versions
{
/// <summary>
/// Gets or sets a value representing Chrome's version string.
/// </summary>
public string Chrome { get; set; }
/// <summary>
/// Gets or sets a value representing Electron's version string.
/// </summary>
public bool Electron { get; set; }
}
}

View File

@@ -83,11 +83,11 @@ namespace ElectronNET.API
/// The process.versions property returns an object listing the version strings of
/// chrome and electron.
/// </summary>
public Task<Versions> VersionsAsync
public Task<ProcessVersions> VersionsAsync
{
get
{
return BridgeConnector.GetValueOverSocketAsync<Versions>(
return BridgeConnector.GetValueOverSocketAsync<ProcessVersions>(
"process-versions", "process-versions-Completed");
}
}