| | | 1 | | // ----------------------------------------------------------------------- |
| | | 2 | | // <copyright file="RegistryPath.cs" company="Stéphane ANDRE"> |
| | | 3 | | // Copyright (c) Stéphane ANDRE. All rights reserved. |
| | | 4 | | // </copyright> |
| | | 5 | | // ----------------------------------------------------------------------- |
| | | 6 | | |
| | | 7 | | namespace MyNet.IO.Registry; |
| | | 8 | | |
| | | 9 | | /// <summary> |
| | | 10 | | /// Represents a registry path, which is a string that specifies the location of a registry key in the Windows Registry. |
| | | 11 | | /// </summary> |
| | | 12 | | /// <param name="Parent">The parent registry path.</param> |
| | | 13 | | /// <param name="Key">The child key to append to the parent path.</param> |
| | | 14 | | public readonly record struct RegistryPath(string Parent, string Key) |
| | | 15 | | { |
| | | 16 | | /// <summary> |
| | | 17 | | /// Combines a parent registry path with a child key to create a new registry path. This method takes a parent regis |
| | | 18 | | /// </summary> |
| | | 19 | | /// <param name="parent">The parent registry path.</param> |
| | | 20 | | /// <param name="key">The child key to append to the parent path.</param> |
| | | 21 | | /// <returns>A new <see cref="RegistryPath"/> instance representing the combined path.</returns> |
| | 167 | 22 | | public static RegistryPath Combine(string parent, string key) => new(parent, key); |
| | | 23 | | |
| | | 24 | | /// <summary> |
| | | 25 | | /// Returns a string representation of the registry path in the format "Parent\Key". This method overrides the defau |
| | | 26 | | /// </summary> |
| | | 27 | | /// <returns>A string representation of the registry path in the format "Parent\Key".</returns> |
| | 291 | 28 | | public override string ToString() => $@"{Parent}\{Key}"; |
| | | 29 | | } |
| | | 30 | | |