Files

190 lines
3.8 KiB
C#

// <auto-generated/> by Diplomat
#pragma warning disable 0105
using System;
using System.Runtime.InteropServices;
using Devolutions.IronRdp.Diplomat;
#pragma warning restore 0105
namespace Devolutions.IronRdp;
#nullable enable
public partial class InclusiveRectangle: IDisposable
{
private unsafe Raw.InclusiveRectangle* _inner;
public ushort Bottom
{
get
{
return GetBottom();
}
}
public ushort Height
{
get
{
return GetHeight();
}
}
public ushort Left
{
get
{
return GetLeft();
}
}
public ushort Right
{
get
{
return GetRight();
}
}
public ushort Top
{
get
{
return GetTop();
}
}
public ushort Width
{
get
{
return GetWidth();
}
}
/// <summary>
/// Creates a managed <c>InclusiveRectangle</c> from a raw handle.
/// </summary>
/// <remarks>
/// Safety: you should not build two managed objects using the same raw handle (may causes use-after-free and double-free).
/// <br/>
/// This constructor assumes the raw struct is allocated on Rust side.
/// If implemented, the custom Drop implementation on Rust side WILL run on destruction.
/// </remarks>
public unsafe InclusiveRectangle(Raw.InclusiveRectangle* handle)
{
_inner = handle;
}
public ushort GetLeft()
{
unsafe
{
if (_inner == null)
{
throw new ObjectDisposedException("InclusiveRectangle");
}
ushort retVal = Raw.InclusiveRectangle.GetLeft(_inner);
return retVal;
}
}
public ushort GetTop()
{
unsafe
{
if (_inner == null)
{
throw new ObjectDisposedException("InclusiveRectangle");
}
ushort retVal = Raw.InclusiveRectangle.GetTop(_inner);
return retVal;
}
}
public ushort GetRight()
{
unsafe
{
if (_inner == null)
{
throw new ObjectDisposedException("InclusiveRectangle");
}
ushort retVal = Raw.InclusiveRectangle.GetRight(_inner);
return retVal;
}
}
public ushort GetBottom()
{
unsafe
{
if (_inner == null)
{
throw new ObjectDisposedException("InclusiveRectangle");
}
ushort retVal = Raw.InclusiveRectangle.GetBottom(_inner);
return retVal;
}
}
public ushort GetWidth()
{
unsafe
{
if (_inner == null)
{
throw new ObjectDisposedException("InclusiveRectangle");
}
ushort retVal = Raw.InclusiveRectangle.GetWidth(_inner);
return retVal;
}
}
public ushort GetHeight()
{
unsafe
{
if (_inner == null)
{
throw new ObjectDisposedException("InclusiveRectangle");
}
ushort retVal = Raw.InclusiveRectangle.GetHeight(_inner);
return retVal;
}
}
/// <summary>
/// Returns the underlying raw handle.
/// </summary>
public unsafe Raw.InclusiveRectangle* AsFFI()
{
return _inner;
}
/// <summary>
/// Destroys the underlying object immediately.
/// </summary>
public void Dispose()
{
unsafe
{
if (_inner == null)
{
return;
}
Raw.InclusiveRectangle.Destroy(_inner);
_inner = null;
GC.SuppressFinalize(this);
}
}
~InclusiveRectangle()
{
Dispose();
}
}