this is all documented in the docs. the RepositoryItem has a static constructor, that is run before the normal constructor, and that invokes the editor. here's how it is in an extension to LookUpEdit i wrote:
/// <summary>
/// Register the <see cref="LookUpEditEx"/> and <see cref="RepositoryItemLookUpEditEx"/>
/// before the main constructor is called.
/// </summary>
/// <remarks>Calls <see cref="RegisterLookUpEditEx"/>.</remarks>
static RepositoryItemLookUpEditEx()
{
RegisterLookUpEditEx();
}
/// <summary>
/// Register this repository item and its editor
/// </summary>
public static void RegisterLookUpEditEx()
{
Image img = null;
try
{
img = (Bitmap)Bitmap.FromStream(Assembly.GetAssembly(typeof(LookUpEdit))
.GetManifestResourceStream("DevExpress.XtraEditors.Bitmaps256.LookUpEdit.bmp"));
}
catch
{
}
EditorRegistrationInfo.Default.Editors.Add(new EditorClassInfo(_editorName,
typeof(LookUpEditEx), typeof(RepositoryItemLookUpEditEx), typeof(LookUpEditViewInfo),
new ButtonEditPainter(), true, img, typeof(PopupEditAccessible)));
}
you also have to override EditorTypeName:
/// <summary>
/// Get the name of the associated <see cref="LookUpEditEx"/> editor
/// </summary>
/// <value>The name of the editor</value>
public override string EditorTypeName
{
get
{
return _editorName; //_editorName=="LookUpEditEx"
}
}
the editor also has a static constructor that registers the RepositoryItem:
/// <summary>
/// Register the <see cref="LookUpEditEx"/> and <see cref="RepositoryItemLookUpEditEx"/>
/// </summary>
static LookUpEditEx()
{
RepositoryItemLookUpEditEx.RegisterLookUpEditEx();
}
and an override of it's own EditorTypeName, that returns "LookUpEdit".