All 5 phases of the open-source Decal rebuild: Phase 1: 14 decompiled .NET projects (Interop.*, Adapter, FileService, DecalUtil) Phase 2: 10 native DLLs rewritten as C# COM servers with matching GUIDs - DecalDat, DHS, SpellFilter, DecalInput, DecalNet, DecalFilters - Decal.Core, DecalControls, DecalRender, D3DService Phase 3: C++ shims for Inject.DLL (D3D9 hooking) and LauncherHook.DLL Phase 4: DenAgent WinForms tray application Phase 5: WiX installer and build script 25 C# projects building with 0 errors. Native C++ projects require VS 2022 + Windows SDK (x86). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
191 lines
3.6 KiB
C#
191 lines
3.6 KiB
C#
using System;
|
|
using Decal.Interop.Controls;
|
|
|
|
namespace Decal.Adapter.Wrappers;
|
|
|
|
public class ChoiceWrapper : ControlWrapperBase<ChoiceClass>
|
|
{
|
|
private EventHandler<ControlEventArgs> evtDropDown;
|
|
|
|
private EventHandler<ControlEventArgs> evtDestroy;
|
|
|
|
private EventHandler<IndexChangeEventArgs> evtChange;
|
|
|
|
private ChoiceTextIndexer myTextIndex;
|
|
|
|
private ChoiceDataIndexer myDataIndex;
|
|
|
|
public int Count => base.Control.ChoiceCount;
|
|
|
|
public int DropLines
|
|
{
|
|
get
|
|
{
|
|
return base.Control.DropLines;
|
|
}
|
|
set
|
|
{
|
|
base.Control.DropLines = value;
|
|
}
|
|
}
|
|
|
|
public bool Dropped
|
|
{
|
|
get
|
|
{
|
|
return base.Control.Dropped;
|
|
}
|
|
set
|
|
{
|
|
base.Control.Dropped = value;
|
|
}
|
|
}
|
|
|
|
public int Selected
|
|
{
|
|
get
|
|
{
|
|
return base.Control.Selected;
|
|
}
|
|
set
|
|
{
|
|
base.Control.Selected = value;
|
|
}
|
|
}
|
|
|
|
public ChoiceTextIndexer Text => myTextIndex;
|
|
|
|
public ChoiceDataIndexer Data => myDataIndex;
|
|
|
|
public event EventHandler<ControlEventArgs> DropDown
|
|
{
|
|
add
|
|
{
|
|
if (evtDropDown == null)
|
|
{
|
|
base.Control.DropDown += DropDownEvent;
|
|
}
|
|
evtDropDown = (EventHandler<ControlEventArgs>)Delegate.Combine(evtDropDown, value);
|
|
}
|
|
remove
|
|
{
|
|
evtDropDown = (EventHandler<ControlEventArgs>)Delegate.Remove(evtDropDown, value);
|
|
if (evtDropDown == null)
|
|
{
|
|
base.Control.DropDown -= DropDownEvent;
|
|
}
|
|
}
|
|
}
|
|
|
|
public event EventHandler<ControlEventArgs> Destroy
|
|
{
|
|
add
|
|
{
|
|
if (evtDestroy == null)
|
|
{
|
|
base.Control.Destroy += DestroyEvent;
|
|
}
|
|
evtDestroy = (EventHandler<ControlEventArgs>)Delegate.Combine(evtDestroy, value);
|
|
}
|
|
remove
|
|
{
|
|
evtDestroy = (EventHandler<ControlEventArgs>)Delegate.Remove(evtDestroy, value);
|
|
if (evtDestroy == null)
|
|
{
|
|
base.Control.Destroy -= DestroyEvent;
|
|
}
|
|
}
|
|
}
|
|
|
|
public event EventHandler<IndexChangeEventArgs> Change
|
|
{
|
|
add
|
|
{
|
|
if (evtChange == null)
|
|
{
|
|
base.Control.Change += ChangeEvent;
|
|
}
|
|
evtChange = (EventHandler<IndexChangeEventArgs>)Delegate.Combine(evtChange, value);
|
|
}
|
|
remove
|
|
{
|
|
evtChange = (EventHandler<IndexChangeEventArgs>)Delegate.Remove(evtChange, value);
|
|
if (evtChange == null)
|
|
{
|
|
base.Control.Change -= ChangeEvent;
|
|
}
|
|
}
|
|
}
|
|
|
|
[CLSCompliant(false)]
|
|
public override void Initialize(object control)
|
|
{
|
|
base.Initialize(control);
|
|
myTextIndex = new ChoiceTextIndexer(base.Control);
|
|
myDataIndex = new ChoiceDataIndexer(base.Control);
|
|
}
|
|
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
if (disposing)
|
|
{
|
|
if (evtDropDown != null)
|
|
{
|
|
evtDropDown = (EventHandler<ControlEventArgs>)Delegate.Remove(evtDropDown, evtDropDown);
|
|
base.Control.DropDown -= DropDownEvent;
|
|
}
|
|
if (evtDestroy != null)
|
|
{
|
|
evtDestroy = (EventHandler<ControlEventArgs>)Delegate.Remove(evtDestroy, evtDestroy);
|
|
base.Control.Destroy -= DestroyEvent;
|
|
}
|
|
if (evtChange != null)
|
|
{
|
|
evtChange = (EventHandler<IndexChangeEventArgs>)Delegate.Remove(evtChange, evtChange);
|
|
base.Control.Change -= ChangeEvent;
|
|
}
|
|
myTextIndex.Dispose();
|
|
myDataIndex.Dispose();
|
|
}
|
|
base.Dispose(disposing);
|
|
}
|
|
|
|
public void Add(string display, object data)
|
|
{
|
|
base.Control.AddChoice(display, data);
|
|
}
|
|
|
|
public void Clear()
|
|
{
|
|
base.Control.Clear();
|
|
}
|
|
|
|
public void Remove(int index)
|
|
{
|
|
base.Control.RemoveChoice(index);
|
|
}
|
|
|
|
private void DropDownEvent(int ID)
|
|
{
|
|
if (evtDropDown != null)
|
|
{
|
|
evtDropDown(this, new ControlEventArgs(ID));
|
|
}
|
|
}
|
|
|
|
private void ChangeEvent(int ID, int Index)
|
|
{
|
|
if (evtChange != null)
|
|
{
|
|
evtChange(this, new IndexChangeEventArgs(ID, Index));
|
|
}
|
|
}
|
|
|
|
private void DestroyEvent(int ID)
|
|
{
|
|
if (evtDestroy != null)
|
|
{
|
|
evtDestroy(this, new ControlEventArgs(ID));
|
|
}
|
|
}
|
|
}
|