Skip to content

Instantly share code, notes, and snippets.

@jasondown
Last active August 3, 2021 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasondown/beb23b9b0048ac5221de44f66445b89a to your computer and use it in GitHub Desktop.
Save jasondown/beb23b9b0048ac5221de44f66445b89a to your computer and use it in GitHub Desktop.
[ControlAddInExport("My Fancy Thing Addin Control")]
public class MyFancyThingAddinControl : WinFormsControlAddInBase
{
private MyFancyThing _myFancyThing;
[ApplicationVisible]
// no need for null checks later
public event MethodInvoker ControlAddInReady = delegate { };
protected override Control CreateControl()
{
_myFancyThing = new MyFancyThing();
_myFancyThing.ParentChanged += (sender, e) => ControlAddInReady();
return _myFancyThing;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment