mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-04 05:34:51 +00:00
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:
10
src/ElectronNET.API/Entities/ProcessVersions.cs
Normal file
10
src/ElectronNET.API/Entities/ProcessVersions.cs
Normal 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);
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user