mirror of
https://github.com/netbirdio/IronRDP.git
synced 2026-05-22 18:43:12 -07:00
178 lines
5.2 KiB
C#
178 lines
5.2 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 ConnectionActivationState: IDisposable
|
|
{
|
|
private unsafe Raw.ConnectionActivationState* _inner;
|
|
|
|
public ConnectionActivationStateCapabilitiesExchange CapabilitiesExchange
|
|
{
|
|
get
|
|
{
|
|
return GetCapabilitiesExchange();
|
|
}
|
|
}
|
|
|
|
public ConnectionActivationStateConnectionFinalization ConnectionFinalization
|
|
{
|
|
get
|
|
{
|
|
return GetConnectionFinalization();
|
|
}
|
|
}
|
|
|
|
public ConnectionActivationStateFinalized Finalized
|
|
{
|
|
get
|
|
{
|
|
return GetFinalized();
|
|
}
|
|
}
|
|
|
|
public ConnectionActivationStateType Type
|
|
{
|
|
get
|
|
{
|
|
return GetType();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Creates a managed <c>ConnectionActivationState</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 ConnectionActivationState(Raw.ConnectionActivationState* handle)
|
|
{
|
|
_inner = handle;
|
|
}
|
|
|
|
/// <returns>
|
|
/// A <c>ConnectionActivationStateType</c> allocated on C# side.
|
|
/// </returns>
|
|
public ConnectionActivationStateType GetType()
|
|
{
|
|
unsafe
|
|
{
|
|
if (_inner == null)
|
|
{
|
|
throw new ObjectDisposedException("ConnectionActivationState");
|
|
}
|
|
Raw.ConnectionActivationStateType retVal = Raw.ConnectionActivationState.GetType(_inner);
|
|
return (ConnectionActivationStateType)retVal;
|
|
}
|
|
}
|
|
|
|
/// <exception cref="IronRdpException"></exception>
|
|
/// <returns>
|
|
/// A <c>ConnectionActivationStateCapabilitiesExchange</c> allocated on Rust side.
|
|
/// </returns>
|
|
public ConnectionActivationStateCapabilitiesExchange GetCapabilitiesExchange()
|
|
{
|
|
unsafe
|
|
{
|
|
if (_inner == null)
|
|
{
|
|
throw new ObjectDisposedException("ConnectionActivationState");
|
|
}
|
|
Raw.ConnectorActivationFfiResultBoxConnectionActivationStateCapabilitiesExchangeBoxIronRdpError result = Raw.ConnectionActivationState.GetCapabilitiesExchange(_inner);
|
|
if (!result.isOk)
|
|
{
|
|
throw new IronRdpException(new IronRdpError(result.Err));
|
|
}
|
|
Raw.ConnectionActivationStateCapabilitiesExchange* retVal = result.Ok;
|
|
return new ConnectionActivationStateCapabilitiesExchange(retVal);
|
|
}
|
|
}
|
|
|
|
/// <exception cref="IronRdpException"></exception>
|
|
/// <returns>
|
|
/// A <c>ConnectionActivationStateConnectionFinalization</c> allocated on Rust side.
|
|
/// </returns>
|
|
public ConnectionActivationStateConnectionFinalization GetConnectionFinalization()
|
|
{
|
|
unsafe
|
|
{
|
|
if (_inner == null)
|
|
{
|
|
throw new ObjectDisposedException("ConnectionActivationState");
|
|
}
|
|
Raw.ConnectorActivationFfiResultBoxConnectionActivationStateConnectionFinalizationBoxIronRdpError result = Raw.ConnectionActivationState.GetConnectionFinalization(_inner);
|
|
if (!result.isOk)
|
|
{
|
|
throw new IronRdpException(new IronRdpError(result.Err));
|
|
}
|
|
Raw.ConnectionActivationStateConnectionFinalization* retVal = result.Ok;
|
|
return new ConnectionActivationStateConnectionFinalization(retVal);
|
|
}
|
|
}
|
|
|
|
/// <exception cref="IronRdpException"></exception>
|
|
/// <returns>
|
|
/// A <c>ConnectionActivationStateFinalized</c> allocated on Rust side.
|
|
/// </returns>
|
|
public ConnectionActivationStateFinalized GetFinalized()
|
|
{
|
|
unsafe
|
|
{
|
|
if (_inner == null)
|
|
{
|
|
throw new ObjectDisposedException("ConnectionActivationState");
|
|
}
|
|
Raw.ConnectorActivationFfiResultBoxConnectionActivationStateFinalizedBoxIronRdpError result = Raw.ConnectionActivationState.GetFinalized(_inner);
|
|
if (!result.isOk)
|
|
{
|
|
throw new IronRdpException(new IronRdpError(result.Err));
|
|
}
|
|
Raw.ConnectionActivationStateFinalized* retVal = result.Ok;
|
|
return new ConnectionActivationStateFinalized(retVal);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns the underlying raw handle.
|
|
/// </summary>
|
|
public unsafe Raw.ConnectionActivationState* AsFFI()
|
|
{
|
|
return _inner;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Destroys the underlying object immediately.
|
|
/// </summary>
|
|
public void Dispose()
|
|
{
|
|
unsafe
|
|
{
|
|
if (_inner == null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
Raw.ConnectionActivationState.Destroy(_inner);
|
|
_inner = null;
|
|
|
|
GC.SuppressFinalize(this);
|
|
}
|
|
}
|
|
|
|
~ConnectionActivationState()
|
|
{
|
|
Dispose();
|
|
}
|
|
}
|