From 3cf5fe92fd3d8e03c7560c0dae4c8cdd6894029c Mon Sep 17 00:00:00 2001 From: Pomian Date: Mon, 18 Oct 2021 13:23:43 +0200 Subject: [PATCH] [Feature] Update library documentation (#580) * Minor IHardware doc fixes * Add XML with documentation to NuGet and output * Update Software namespace docs * Update some internal classes * Update main Computer class docs * Update interfaces docs * Update Computer class documentation * Update motherboard docs * Update hardware docs * Fix code formatting * Update SensorVisitor handler doc --- LibreHardwareMonitorLib/Hardware/Computer.cs | 84 ++++++++----------- LibreHardwareMonitorLib/Hardware/Hardware.cs | 29 +++++++ .../Hardware/HardwareType.cs | 26 ++++++ LibreHardwareMonitorLib/Hardware/IComputer.cs | 65 +++++++++++++- LibreHardwareMonitorLib/Hardware/IHardware.cs | 36 +++----- .../Hardware/IParameter.cs | 24 ++++++ .../Hardware/ISensorLimits.cs | 18 ++++ LibreHardwareMonitorLib/Hardware/ISettings.cs | 21 +++++ LibreHardwareMonitorLib/Hardware/IVisitor.cs | 16 ++++ .../Hardware/Identifier.cs | 10 ++- .../Hardware/Motherboard/Motherboard.cs | 35 +++++++- .../Hardware/ParameterDescription.cs | 18 ++++ .../Hardware/SensorVisitor.cs | 26 ++++++ LibreHardwareMonitorLib/Interop/Ring0.cs | 3 + LibreHardwareMonitorLib/Interop/WinNt.cs | 9 ++ .../LibreHardwareMonitorLib.csproj | 3 + .../Software/OperatingSystem.cs | 12 +++ 17 files changed, 354 insertions(+), 81 deletions(-) create mode 100644 LibreHardwareMonitorLib/Hardware/HardwareType.cs diff --git a/LibreHardwareMonitorLib/Hardware/Computer.cs b/LibreHardwareMonitorLib/Hardware/Computer.cs index 46912e1..da48e94 100644 --- a/LibreHardwareMonitorLib/Hardware/Computer.cs +++ b/LibreHardwareMonitorLib/Hardware/Computer.cs @@ -28,38 +28,46 @@ namespace LibreHardwareMonitor.Hardware /// public class Computer : IComputer { + /// public event HardwareEventHandler HardwareAdded; + + /// public event HardwareEventHandler HardwareRemoved; + private readonly object _lock = new object(); private readonly List _groups = new List(); private readonly ISettings _settings; + private bool _controllerEnabled; private bool _cpuEnabled; private bool _gpuEnabled; - private readonly object _lock = new object(); private bool _memoryEnabled; private bool _motherboardEnabled; private bool _networkEnabled; private bool _open; - private SMBios _smbios; private bool _storageEnabled; private bool _psuEnabled; + private SMBios _smbios; + + /// + /// Creates a new instance with basic initial . + /// public Computer() { _settings = new Settings(); } + /// + /// Creates a new instance with additional . + /// + /// Computer settings that will be transferred to each . public Computer(ISettings settings) { _settings = settings ?? new Settings(); } - /// - /// Gets a list of all known after calling . - /// Can be updated by . - /// - /// List of all enabled devices. + /// public IList Hardware { get @@ -90,10 +98,7 @@ namespace LibreHardwareMonitor.Hardware } } - /// - /// Gets or sets a value indicating whether collecting information about devices should be enabled and updated. - /// - /// if a given category of devices is already enabled. + /// public bool IsCpuEnabled { get { return _cpuEnabled; } @@ -111,18 +116,7 @@ namespace LibreHardwareMonitor.Hardware } } - /// - /// Gets or sets a value indicating whether collecting information about: - /// - /// - /// - /// - /// - /// - /// - /// devices should be enabled and updated. - /// - /// if a given category of devices is already enabled. + /// public bool IsControllerEnabled { get { return _controllerEnabled; } @@ -152,10 +146,7 @@ namespace LibreHardwareMonitor.Hardware } } - /// - /// Gets or sets a value indicating whether collecting information about or devices should be enabled and updated. - /// - /// if a given category of devices is already enabled. + /// public bool IsGpuEnabled { get { return _gpuEnabled; } @@ -179,10 +170,7 @@ namespace LibreHardwareMonitor.Hardware } } - /// - /// Gets or sets a value indicating whether collecting information about devices should be enabled and updated. - /// - /// if a given category of devices is already enabled. + /// public bool IsMemoryEnabled { get { return _memoryEnabled; } @@ -200,10 +188,7 @@ namespace LibreHardwareMonitor.Hardware } } - /// - /// Gets or sets a value indicating whether collecting information about devices should be enabled and updated. - /// - /// if a given category of devices is already enabled. + /// public bool IsMotherboardEnabled { get { return _motherboardEnabled; } @@ -221,10 +206,7 @@ namespace LibreHardwareMonitor.Hardware } } - /// - /// Gets or sets a value indicating whether collecting information about devices should be enabled and updated. - /// - /// if a given category of devices is already enabled. + /// public bool IsNetworkEnabled { get { return _networkEnabled; } @@ -242,10 +224,7 @@ namespace LibreHardwareMonitor.Hardware } } - /// - /// Gets or sets a value indicating whether collecting information about devices should be enabled and updated. - /// - /// if a given category of devices is already enabled. + /// public bool IsStorageEnabled { get { return _storageEnabled; } @@ -263,10 +242,7 @@ namespace LibreHardwareMonitor.Hardware } } - /// - /// Gets or sets a value indicating whether collecting information about devices should be enabled and updated. - /// - /// if a given category of devices is already enabled. + /// public bool IsPsuEnabled { get { return _psuEnabled; } @@ -287,10 +263,7 @@ namespace LibreHardwareMonitor.Hardware } } - /// - /// Generates full LibreHardwareMonitor report for devices that have been enabled. - /// - /// A formatted text string with library, OS and hardware information. + //// public string GetReport() { lock (_lock) @@ -610,6 +583,9 @@ namespace LibreHardwareMonitor.Hardware ReportHardware(subHardware, w); } + /// + /// If opened before, removes all and triggers , and . + /// public void Close() { if (!_open) @@ -633,6 +609,9 @@ namespace LibreHardwareMonitor.Hardware _open = false; } + /// + /// If opened before, removes all and recreates it. + /// public void Reset() { if (!_open) @@ -655,6 +634,9 @@ namespace LibreHardwareMonitor.Hardware } } + /// + /// specific additional settings passed to its . + /// private class Settings : ISettings { public bool Contains(string name) diff --git a/LibreHardwareMonitorLib/Hardware/Hardware.cs b/LibreHardwareMonitorLib/Hardware/Hardware.cs index 6c70c2c..6f0a34c 100644 --- a/LibreHardwareMonitorLib/Hardware/Hardware.cs +++ b/LibreHardwareMonitorLib/Hardware/Hardware.cs @@ -10,6 +10,12 @@ using System.Linq; namespace LibreHardwareMonitor.Hardware { + /// + /// Object representing a component of the computer. + /// + /// Individual information can be read from the . + /// + /// public abstract class Hardware : IHardware { protected readonly HashSet _active = new(); @@ -17,6 +23,12 @@ namespace LibreHardwareMonitor.Hardware protected readonly ISettings _settings; private string _customName; + /// + /// Creates a new instance based on the data provided. + /// + /// Component name. + /// Identifier that will be assigned to the device. Based on + /// Additional settings passed by the . protected Hardware(string name, Identifier identifier, ISettings settings) { _settings = settings; @@ -25,12 +37,18 @@ namespace LibreHardwareMonitor.Hardware _customName = settings.GetValue(new Identifier(Identifier, "name").ToString(), name); } + /// + /// Event triggered when is closing. + /// public event HardwareEventHandler Closing; + /// public abstract HardwareType HardwareType { get; } + /// public Identifier Identifier { get; } + /// public string Name { get { return _customName; } @@ -42,30 +60,37 @@ namespace LibreHardwareMonitor.Hardware } } + /// public virtual IHardware Parent { get { return null; } } + /// public virtual IDictionary Properties => new SortedDictionary(); + /// public virtual ISensor[] Sensors { get { return _active.ToArray(); } } + /// public IHardware[] SubHardware { get { return new IHardware[0]; } } + /// public virtual string GetReport() { return null; } + /// public abstract void Update(); + /// public void Accept(IVisitor visitor) { if (visitor == null) @@ -75,24 +100,28 @@ namespace LibreHardwareMonitor.Hardware visitor.VisitHardware(this); } + /// public virtual void Traverse(IVisitor visitor) { foreach (ISensor sensor in _active) sensor.Accept(visitor); } + /// protected virtual void ActivateSensor(ISensor sensor) { if (_active.Add(sensor)) SensorAdded?.Invoke(sensor); } + /// protected virtual void DeactivateSensor(ISensor sensor) { if (_active.Remove(sensor)) SensorRemoved?.Invoke(sensor); } + /// public virtual void Close() { Closing?.Invoke(this); diff --git a/LibreHardwareMonitorLib/Hardware/HardwareType.cs b/LibreHardwareMonitorLib/Hardware/HardwareType.cs new file mode 100644 index 0000000..6db7aa2 --- /dev/null +++ b/LibreHardwareMonitorLib/Hardware/HardwareType.cs @@ -0,0 +1,26 @@ +// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +// If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. +// Copyright (C) LibreHardwareMonitor and Contributors. +// Partial Copyright (C) Michael Möller and Contributors. +// All Rights Reserved. + +namespace LibreHardwareMonitor.Hardware +{ + /// + /// Collection of identifiers representing the purpose of the hardware. + /// + public enum HardwareType + { + Motherboard, + SuperIO, + Cpu, + Memory, + GpuNvidia, + GpuAmd, + Storage, + Network, + Cooler, + EmbeddedController, + Psu + } +} diff --git a/LibreHardwareMonitorLib/Hardware/IComputer.cs b/LibreHardwareMonitorLib/Hardware/IComputer.cs index 1cd169b..1b40a38 100644 --- a/LibreHardwareMonitorLib/Hardware/IComputer.cs +++ b/LibreHardwareMonitorLib/Hardware/IComputer.cs @@ -8,6 +8,10 @@ using System.Collections.Generic; namespace LibreHardwareMonitor.Hardware { + /// + /// Handler that will trigger the actions assigned to it when the event occurs. + /// + /// Component returned to the assigned action(s). public delegate void HardwareEventHandler(IHardware hardware); /// @@ -15,28 +19,83 @@ namespace LibreHardwareMonitor.Hardware /// public interface IComputer : IElement { + /// + /// Gets or sets a value indicating whether collecting information about devices should be enabled and updated. + /// + /// if a given category of devices is already enabled. bool IsCpuEnabled { get; } + /// + /// Gets or sets a value indicating whether collecting information about: + /// + /// + /// + /// + /// + /// + /// + /// devices should be enabled and updated. + /// + /// if a given category of devices is already enabled. bool IsControllerEnabled { get; } + /// + /// Gets or sets a value indicating whether collecting information about or devices should be enabled and updated. + /// + /// if a given category of devices is already enabled. bool IsGpuEnabled { get; } - IList Hardware { get; } - + /// + /// Gets or sets a value indicating whether collecting information about devices should be enabled and updated. + /// + /// if a given category of devices is already enabled. bool IsStorageEnabled { get; } + /// + /// Gets or sets a value indicating whether collecting information about devices should be enabled and updated. + /// + /// if a given category of devices is already enabled. bool IsMotherboardEnabled { get; } + /// + /// Gets or sets a value indicating whether collecting information about devices should be enabled and updated. + /// + /// if a given category of devices is already enabled. bool IsNetworkEnabled { get; } + /// + /// Gets or sets a value indicating whether collecting information about devices should be enabled and updated. + /// + /// if a given category of devices is already enabled. bool IsMemoryEnabled { get; } + /// + /// Gets or sets a value indicating whether collecting information about devices should be enabled and updated. + /// + /// if a given category of devices is already enabled. bool IsPsuEnabled { get; } - string GetReport(); + /// + /// Gets a list of all known . + /// Can be updated by . + /// + /// List of all enabled devices. + IList Hardware { get; } + /// + /// Triggered when a new is registered. + /// event HardwareEventHandler HardwareAdded; + /// + /// Triggered when a is removed. + /// event HardwareEventHandler HardwareRemoved; + + /// + /// Generates full LibreHardwareMonitor report for devices that have been enabled. + /// + /// A formatted text string with library, OS and hardware information. + string GetReport(); } } diff --git a/LibreHardwareMonitorLib/Hardware/IHardware.cs b/LibreHardwareMonitorLib/Hardware/IHardware.cs index 0aa852c..666845b 100644 --- a/LibreHardwareMonitorLib/Hardware/IHardware.cs +++ b/LibreHardwareMonitorLib/Hardware/IHardware.cs @@ -8,28 +8,18 @@ using System.Collections.Generic; namespace LibreHardwareMonitor.Hardware { + /// + /// Handler that will trigger the actions assigned to it when the event occurs. + /// + /// Component returned to the assigned action(s). public delegate void SensorEventHandler(ISensor sensor); /// - /// Reflects what category the device is. - /// - public enum HardwareType - { - Motherboard, - SuperIO, - Cpu, - Memory, - GpuNvidia, - GpuAmd, - Storage, - Network, - Cooler, - EmbeddedController, - Psu - } - - /// - /// An abstract object that stores information about a device. All sensors are available as an array of . + /// Abstract object that stores information about a device. All sensors are available as an array of . + /// + /// Can contain . + /// Type specified in . + /// /// public interface IHardware : IElement { @@ -39,7 +29,7 @@ namespace LibreHardwareMonitor.Hardware HardwareType HardwareType { get; } /// - /// Gets unique hardware identifier obtained from the computer. + /// Gets a unique hardware ID that represents its location. /// Identifier Identifier { get; } @@ -54,12 +44,12 @@ namespace LibreHardwareMonitor.Hardware IHardware Parent { get; } /// - /// Gets an array of all sensors such as temperature, clocks, load etc. + /// Gets an array of all sensors such as , , etc. /// ISensor[] Sensors { get; } /// - /// Gets child devices, e.g. SuperIO of the motherboard. + /// Gets child devices, e.g. of the . /// IHardware[] SubHardware { get; } @@ -86,7 +76,7 @@ namespace LibreHardwareMonitor.Hardware event SensorEventHandler SensorRemoved; /// - /// Rarely changed hardware properties that can't be represented as sensors. + /// Gets rarely changed hardware properties that can't be represented as sensors. /// IDictionary Properties { get; } } diff --git a/LibreHardwareMonitorLib/Hardware/IParameter.cs b/LibreHardwareMonitorLib/Hardware/IParameter.cs index d5e301c..0b72b7f 100644 --- a/LibreHardwareMonitorLib/Hardware/IParameter.cs +++ b/LibreHardwareMonitorLib/Hardware/IParameter.cs @@ -6,20 +6,44 @@ namespace LibreHardwareMonitor.Hardware { + /// + /// Abstract object that represents additional parameters included in . + /// public interface IParameter : IElement { + /// + /// Gets a parameter default value defined by library. + /// float DefaultValue { get; } + /// + /// Gets a parameter description defined by library. + /// string Description { get; } + /// + /// Gets a unique parameter ID that represents its location. + /// Identifier Identifier { get; } + /// + /// Gets or sets information whether the given is the default for . + /// bool IsDefault { get; set; } + /// + /// Gets a parameter name defined by library. + /// string Name { get; } + /// + /// Gets the sensor that is the data container for the given parameter. + /// ISensor Sensor { get; } + /// + /// Gets or sets the current value. + /// float Value { get; set; } } } diff --git a/LibreHardwareMonitorLib/Hardware/ISensorLimits.cs b/LibreHardwareMonitorLib/Hardware/ISensorLimits.cs index 9bf2aef..1939732 100644 --- a/LibreHardwareMonitorLib/Hardware/ISensorLimits.cs +++ b/LibreHardwareMonitorLib/Hardware/ISensorLimits.cs @@ -5,17 +5,35 @@ namespace LibreHardwareMonitor.Hardware { + /// + /// Abstract object that stores information about the limits of . + /// public interface ISensorLimits { + /// + /// Upper limit of value. + /// float? HighLimit { get; } + /// + /// Lower limit of value. + /// float? LowLimit { get; } } + /// + /// Abstract object that stores information about the critical limits of . + /// public interface ICriticalSensorLimits { + /// + /// Critical upper limit of value. + /// float? CriticalHighLimit { get; } + /// + /// Critical lower limit of value. + /// float? CriticalLowLimit { get; } } } diff --git a/LibreHardwareMonitorLib/Hardware/ISettings.cs b/LibreHardwareMonitorLib/Hardware/ISettings.cs index 846beea..91a25e1 100644 --- a/LibreHardwareMonitorLib/Hardware/ISettings.cs +++ b/LibreHardwareMonitorLib/Hardware/ISettings.cs @@ -6,14 +6,35 @@ namespace LibreHardwareMonitor.Hardware { + /// + /// Abstract object that stores settings passed to , and . + /// public interface ISettings { + /// + /// Returns information whether the given collection of settings contains a value assigned to the given key. + /// + /// Key to which the setting value is assigned. bool Contains(string name); + /// + /// Assigns a setting option to a given key. + /// + /// Key to which the setting value is assigned. + /// Text setting value. void SetValue(string name, string value); + /// + /// Gets a setting option assigned to the given key. + /// + /// Key to which the setting value is assigned. + /// Default value. string GetValue(string name, string value); + /// + /// Removes a setting with the specified key from the settings collection. + /// + /// Key to which the setting value is assigned. void Remove(string name); } } diff --git a/LibreHardwareMonitorLib/Hardware/IVisitor.cs b/LibreHardwareMonitorLib/Hardware/IVisitor.cs index 872fad5..ccae364 100644 --- a/LibreHardwareMonitorLib/Hardware/IVisitor.cs +++ b/LibreHardwareMonitorLib/Hardware/IVisitor.cs @@ -11,12 +11,28 @@ namespace LibreHardwareMonitor.Hardware /// public interface IVisitor { + /// + /// Refreshes the values of all in all on selected . + /// + /// Instance of the computer to be revisited. void VisitComputer(IComputer computer); + /// + /// Refreshes the values of all on selected . + /// + /// Instance of the hardware to be revisited. void VisitHardware(IHardware hardware); + /// + /// Refreshes the values on selected . + /// + /// Instance of the sensor to be revisited. void VisitSensor(ISensor sensor); + /// + /// Refreshes the values on selected . + /// + /// Instance of the parameter to be revisited. void VisitParameter(IParameter parameter); } } diff --git a/LibreHardwareMonitorLib/Hardware/Identifier.cs b/LibreHardwareMonitorLib/Hardware/Identifier.cs index 2f5663a..f3d5ac5 100644 --- a/LibreHardwareMonitorLib/Hardware/Identifier.cs +++ b/LibreHardwareMonitorLib/Hardware/Identifier.cs @@ -10,6 +10,9 @@ using System.Text; namespace LibreHardwareMonitor.Hardware { + /// + /// Represents a unique / identifier in text format with a / separator. + /// public class Identifier : IComparable { private const char Separator = '/'; @@ -28,6 +31,11 @@ namespace LibreHardwareMonitor.Hardware _identifier = s.ToString(); } + /// + /// Creates a new identifier instance based on the base and additional elements. + /// + /// Base identifier being the beginning of the new one. + /// Additional parts by which the base will be extended. public Identifier(Identifier identifier, params string[] extensions) { CheckIdentifiers(extensions); @@ -87,7 +95,7 @@ namespace LibreHardwareMonitor.Hardware } public static bool operator ==(Identifier id1, Identifier id2) - { + { if (ReferenceEquals(id1, null) && ReferenceEquals(id2, null)) return true; diff --git a/LibreHardwareMonitorLib/Hardware/Motherboard/Motherboard.cs b/LibreHardwareMonitorLib/Hardware/Motherboard/Motherboard.cs index 013c9da..99c7817 100644 --- a/LibreHardwareMonitorLib/Hardware/Motherboard/Motherboard.cs +++ b/LibreHardwareMonitorLib/Hardware/Motherboard/Motherboard.cs @@ -13,6 +13,9 @@ using OperatingSystem = LibreHardwareMonitor.Software.OperatingSystem; namespace LibreHardwareMonitor.Hardware.Motherboard { + /// + /// Represents the motherboard of a computer with its and as . + /// public class Motherboard : IHardware { private readonly LMSensors _lmSensors; @@ -21,6 +24,11 @@ namespace LibreHardwareMonitor.Hardware.Motherboard private readonly ISettings _settings; private string _customName; + /// + /// Creates motherboard instance by retrieving information from and creates a new based on data from and . + /// + /// table containing motherboard data. + /// Additional settings passed by . public Motherboard(SMBios smBios, ISettings settings) { IReadOnlyList superIO; @@ -61,7 +69,7 @@ namespace LibreHardwareMonitor.Hardware.Motherboard _lpcIO = new LpcIO(); superIO = _lpcIO.SuperIO; } - + EmbeddedController embeddedController = EmbeddedController.Create(model, settings); SubHardware = new IHardware[superIO.Count + (embeddedController != null ? 1 : 0)]; @@ -72,20 +80,27 @@ namespace LibreHardwareMonitor.Hardware.Motherboard SubHardware[superIO.Count] = embeddedController; } + /// public event SensorEventHandler SensorAdded; + /// public event SensorEventHandler SensorRemoved; + /// public HardwareType HardwareType { get { return HardwareType.Motherboard; } } + /// public Identifier Identifier { get { return new Identifier("motherboard"); } } + /// + /// Gets the name obtained from . + /// public string Name { get { return _customName; } @@ -97,25 +112,31 @@ namespace LibreHardwareMonitor.Hardware.Motherboard } } + /// + /// Always public virtual IHardware Parent { get { return null; } } + /// public virtual IDictionary Properties => new SortedDictionary(); + /// public ISensor[] Sensors { get { return new ISensor[0]; } } /// - /// Gets the SMBios information. + /// Gets the information. /// public SMBios SMBios { get; } + /// public IHardware[] SubHardware { get; } + /// public string GetReport() { StringBuilder r = new(); @@ -130,9 +151,13 @@ namespace LibreHardwareMonitor.Hardware.Motherboard return r.ToString(); } + /// + /// Motherboard itself cannot be updated. Update instead. + /// public void Update() - { } + {} + /// public void Accept(IVisitor visitor) { if (visitor == null) @@ -142,12 +167,16 @@ namespace LibreHardwareMonitor.Hardware.Motherboard visitor.VisitHardware(this); } + /// public void Traverse(IVisitor visitor) { foreach (IHardware hardware in SubHardware) hardware.Accept(visitor); } + /// + /// Closes using . + /// public void Close() { _lmSensors?.Close(); diff --git a/LibreHardwareMonitorLib/Hardware/ParameterDescription.cs b/LibreHardwareMonitorLib/Hardware/ParameterDescription.cs index 7dbbdef..61fe6c5 100644 --- a/LibreHardwareMonitorLib/Hardware/ParameterDescription.cs +++ b/LibreHardwareMonitorLib/Hardware/ParameterDescription.cs @@ -6,8 +6,17 @@ namespace LibreHardwareMonitor.Hardware { + /// + /// Composite class containing information about the selected . + /// public struct ParameterDescription { + /// + /// Creates a new instance and assigns values. + /// + /// Name of the selected component. + /// Description of the selected component. + /// Default value of the selected component. public ParameterDescription(string name, string description, float defaultValue) { Name = name; @@ -15,10 +24,19 @@ namespace LibreHardwareMonitor.Hardware DefaultValue = defaultValue; } + /// + /// Gets a name of the parent . + /// public string Name { get; } + /// + /// Gets a description of the parent . + /// public string Description { get; } + /// + /// Gets a default value of the parent . + /// public float DefaultValue { get; } } } diff --git a/LibreHardwareMonitorLib/Hardware/SensorVisitor.cs b/LibreHardwareMonitorLib/Hardware/SensorVisitor.cs index 6d3ac7c..e3098ed 100644 --- a/LibreHardwareMonitorLib/Hardware/SensorVisitor.cs +++ b/LibreHardwareMonitorLib/Hardware/SensorVisitor.cs @@ -8,15 +8,26 @@ using System; namespace LibreHardwareMonitor.Hardware { + /// + /// Observer making calls to selected component 's. + /// public class SensorVisitor : IVisitor { private readonly SensorEventHandler _handler; + /// + /// Creates a new observer instance. + /// + /// Instance of the that triggers events during visiting the . public SensorVisitor(SensorEventHandler handler) { _handler = handler ?? throw new ArgumentNullException(nameof(handler)); } + /// + /// Goes through all the components of the specified with its . + /// + /// Computer class instance that is derived from the interface. public void VisitComputer(IComputer computer) { if (computer == null) @@ -26,6 +37,10 @@ namespace LibreHardwareMonitor.Hardware computer.Traverse(this); } + /// + /// Goes through all the components of the specified with its . + /// + /// Hardware class instance that is derived from the interface. public void VisitHardware(IHardware hardware) { if (hardware == null) @@ -35,11 +50,22 @@ namespace LibreHardwareMonitor.Hardware hardware.Traverse(this); } + /// + /// Goes through all the components of the specified using . + /// + /// Sensor class instance that is derived from the interface. public void VisitSensor(ISensor sensor) { _handler(sensor); } + /// + /// Goes through all the components of the specified . + /// + /// + /// + /// + /// Parameter class instance that is derived from the interface. public void VisitParameter(IParameter parameter) { } } diff --git a/LibreHardwareMonitorLib/Interop/Ring0.cs b/LibreHardwareMonitorLib/Interop/Ring0.cs index e4d69e1..4eaeec9 100644 --- a/LibreHardwareMonitorLib/Interop/Ring0.cs +++ b/LibreHardwareMonitorLib/Interop/Ring0.cs @@ -8,6 +8,9 @@ namespace LibreHardwareMonitor.Interop { + /// + /// Driver with access at kernel level. + /// internal static class Ring0 { public const uint INVALID_PCI_ADDRESS = 0xFFFFFFFF; diff --git a/LibreHardwareMonitorLib/Interop/WinNt.cs b/LibreHardwareMonitorLib/Interop/WinNt.cs index dbc7d10..8e78304 100644 --- a/LibreHardwareMonitorLib/Interop/WinNt.cs +++ b/LibreHardwareMonitorLib/Interop/WinNt.cs @@ -10,10 +10,16 @@ using System.Runtime.InteropServices; namespace LibreHardwareMonitor.Interop { + /// + /// Contains Win32 definitions for Windows NT. + /// internal static class WinNt { internal const int STATUS_SUCCESS = 0; + /// + /// Describes a local identifier for an adapter. + /// [StructLayout(LayoutKind.Sequential)] internal struct LUID { @@ -21,6 +27,9 @@ namespace LibreHardwareMonitor.Interop public readonly int HighPart; } + /// + /// Represents a 64-bit signed integer value. + /// [StructLayout(LayoutKind.Explicit, Size = 8)] internal struct LARGE_INTEGER { diff --git a/LibreHardwareMonitorLib/LibreHardwareMonitorLib.csproj b/LibreHardwareMonitorLib/LibreHardwareMonitorLib.csproj index 26efd4b..e29082e 100644 --- a/LibreHardwareMonitorLib/LibreHardwareMonitorLib.csproj +++ b/LibreHardwareMonitorLib/LibreHardwareMonitorLib.csproj @@ -24,6 +24,9 @@ ..\bin\Release\ + + true + diff --git a/LibreHardwareMonitorLib/Software/OperatingSystem.cs b/LibreHardwareMonitorLib/Software/OperatingSystem.cs index bdd7657..e789117 100644 --- a/LibreHardwareMonitorLib/Software/OperatingSystem.cs +++ b/LibreHardwareMonitorLib/Software/OperatingSystem.cs @@ -8,8 +8,14 @@ using System; namespace LibreHardwareMonitor.Software { + /// + /// Contains basic information about the operating system. + /// public static class OperatingSystem { + /// + /// Statically checks if the current system and . + /// static OperatingSystem() { // The operating system doesn't change during execution so let's query it just one time. @@ -20,8 +26,14 @@ namespace LibreHardwareMonitor.Software Is64Bit = true; } + /// + /// Gets information about whether the current system is 64 bit. + /// public static bool Is64Bit { get; } + /// + /// Gets information about whether the current system is Unix based. + /// public static bool IsUnix { get; } } }