private static void HookInkImpl(IInkHooks subject, Control control) { HookAdapter adapter = new HookAdapter(subject); control.CreateControl(); StylusReader.HookStylus(adapter, control); }
/// <summary> /// Hooks Ink support in to a control. /// </summary> /// <param name="subject"></param> /// <param name="control"></param> /// <exception cref="NotSupportedException">IsAvailable() returned false</exception> /// <remarks>Ink support will be automatically unhooked when the control's Disposed event is raised.</remarks> public static void HookInk(IInkHooks subject, Control control) { if (!IsAvailable()) { throw new NotSupportedException("Ink is not available"); } HookInkImpl(subject, control); }
public HookAdapter(IInkHooks subject) { this.subject = subject; }