// 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 ConnectionActivationStateFinalized: IDisposable { private unsafe Raw.ConnectionActivationStateFinalized* _inner; public DesktopSize DesktopSize { get { return GetDesktopSize(); } } public bool EnableServerPointer { get { return GetEnableServerPointer(); } } public ushort IoChannelId { get { return GetIoChannelId(); } } public bool PointerSoftwareRendering { get { return GetPointerSoftwareRendering(); } } public ushort UserChannelId { get { return GetUserChannelId(); } } /// /// Creates a managed ConnectionActivationStateFinalized from a raw handle. /// /// /// Safety: you should not build two managed objects using the same raw handle (may causes use-after-free and double-free). ///
/// This constructor assumes the raw struct is allocated on Rust side. /// If implemented, the custom Drop implementation on Rust side WILL run on destruction. ///
public unsafe ConnectionActivationStateFinalized(Raw.ConnectionActivationStateFinalized* handle) { _inner = handle; } public ushort GetIoChannelId() { unsafe { if (_inner == null) { throw new ObjectDisposedException("ConnectionActivationStateFinalized"); } ushort retVal = Raw.ConnectionActivationStateFinalized.GetIoChannelId(_inner); return retVal; } } public ushort GetUserChannelId() { unsafe { if (_inner == null) { throw new ObjectDisposedException("ConnectionActivationStateFinalized"); } ushort retVal = Raw.ConnectionActivationStateFinalized.GetUserChannelId(_inner); return retVal; } } /// /// A DesktopSize allocated on Rust side. /// public DesktopSize GetDesktopSize() { unsafe { if (_inner == null) { throw new ObjectDisposedException("ConnectionActivationStateFinalized"); } Raw.DesktopSize* retVal = Raw.ConnectionActivationStateFinalized.GetDesktopSize(_inner); return new DesktopSize(retVal); } } public bool GetEnableServerPointer() { unsafe { if (_inner == null) { throw new ObjectDisposedException("ConnectionActivationStateFinalized"); } bool retVal = Raw.ConnectionActivationStateFinalized.GetEnableServerPointer(_inner); return retVal; } } public bool GetPointerSoftwareRendering() { unsafe { if (_inner == null) { throw new ObjectDisposedException("ConnectionActivationStateFinalized"); } bool retVal = Raw.ConnectionActivationStateFinalized.GetPointerSoftwareRendering(_inner); return retVal; } } /// /// Returns the underlying raw handle. /// public unsafe Raw.ConnectionActivationStateFinalized* AsFFI() { return _inner; } /// /// Destroys the underlying object immediately. /// public void Dispose() { unsafe { if (_inner == null) { return; } Raw.ConnectionActivationStateFinalized.Destroy(_inner); _inner = null; GC.SuppressFinalize(this); } } ~ConnectionActivationStateFinalized() { Dispose(); } }