using System; using System.Runtime.InteropServices; using NvAPIWrapper.Native.Attributes; using NvAPIWrapper.Native.Interfaces; namespace NvAPIWrapper.Native.General.Structures { /// /// Holds information about the lid and dock /// [StructLayout(LayoutKind.Sequential, Pack = 8)] [StructureVersion(1)] public struct LidDockParameters : IInitializable, IEquatable { internal StructureVersion _Version; internal readonly uint _CurrentLIDState; internal readonly uint _CurrentDockState; internal readonly uint _CurrentLIDPolicy; internal readonly uint _CurrentDockPolicy; internal readonly uint _ForcedLIDMechanismPresent; internal readonly uint _ForcedDockMechanismPresent; /// public bool Equals(LidDockParameters other) { return _CurrentLIDState == other._CurrentLIDState && _CurrentDockState == other._CurrentDockState && _CurrentLIDPolicy == other._CurrentLIDPolicy && _CurrentDockPolicy == other._CurrentDockPolicy && _ForcedLIDMechanismPresent == other._ForcedLIDMechanismPresent && _ForcedDockMechanismPresent == other._ForcedDockMechanismPresent; } /// public override bool Equals(object obj) { if (ReferenceEquals(null, obj)) { return false; } return obj is LidDockParameters parameters && Equals(parameters); } /// public override int GetHashCode() { unchecked { var hashCode = (int) _CurrentLIDState; hashCode = (hashCode * 397) ^ (int) _CurrentDockState; hashCode = (hashCode * 397) ^ (int) _CurrentLIDPolicy; hashCode = (hashCode * 397) ^ (int) _CurrentDockPolicy; hashCode = (hashCode * 397) ^ (int) _ForcedLIDMechanismPresent; hashCode = (hashCode * 397) ^ (int) _ForcedDockMechanismPresent; return hashCode; } } /// /// Gets current lid state /// public uint CurrentLidState { get => _CurrentLIDState; } /// /// Gets current dock state /// public uint CurrentDockState { get => _CurrentDockState; } /// /// Gets current lid policy /// public uint CurrentLidPolicy { get => _CurrentLIDPolicy; } /// /// Gets current dock policy /// public uint CurrentDockPolicy { get => _CurrentDockPolicy; } /// /// Gets forced lid mechanism present /// public uint ForcedLidMechanismPresent { get => _ForcedLIDMechanismPresent; } /// /// Gets forced dock mechanism present /// public uint ForcedDockMechanismPresent { get => _ForcedDockMechanismPresent; } } }