HDC
using System;
using System.CodeDom.Compiler;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using Windows.Win32.Foundation;
namespace Windows.Win32.Graphics.Gdi
{
[DebuggerDisplay("{Value}")]
[GeneratedCode("Microsoft.Windows.CsWin32", "0.3.106+a37a0b4b70")]
internal readonly struct HDC : IHandle<HDC>, IEquatable<HDC>
{
internal readonly IntPtr Value;
HDC IHandle<HDC>.Handle {
get {
return this;
}
}
[Nullable(2)]
object IHandle<HDC>.Wrapper {
[NullableContext(2)]
get {
return null;
}
}
public static HDC Null => default(HDC);
public bool IsNull => Value == (IntPtr)0;
internal HDC(IntPtr value)
{
Value = value;
}
public static implicit operator IntPtr(HDC value)
{
return value.Value;
}
public static explicit operator HDC(IntPtr value)
{
return new HDC(value);
}
public static bool operator ==(HDC left, HDC right)
{
return left.Value == right.Value;
}
public static bool operator !=(HDC left, HDC right)
{
return !(left == right);
}
public bool Equals(HDC other)
{
return Value == other.Value;
}
public override bool Equals(object obj)
{
if (obj is HDC) {
HDC other = (HDC)obj;
return Equals(other);
}
return false;
}
public override int GetHashCode()
{
return Value.GetHashCode();
}
public override string ToString()
{
DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(2, 1);
defaultInterpolatedStringHandler.AppendLiteral("0x");
defaultInterpolatedStringHandler.AppendFormatted(Value, "x");
return defaultInterpolatedStringHandler.ToStringAndClear();
}
}
}