using System;
using System.Runtime.InteropServices;
using Decal.Interop.Controls;

namespace Decal.Adapter.Wrappers;

public sealed class ChoiceDataIndexer : IDisposable
{
	private Choice myControl;

	public object this[int index]
	{
		get
		{
			return ((IChoice)myControl).get_Data(index);
		}
		set
		{
			((IChoice)myControl).set_Data(index, value);
		}
	}

	internal ChoiceDataIndexer(Choice control)
	{
		myControl = control;
	}

	public void Dispose()
	{
		Marshal.ReleaseComObject(myControl);
		myControl = null;
	}
}
