/// <summary> /// If your form needs this kind of input focus, be sure to say so. /// Really, this only makes sense for mouse, but I've started building it out for other things /// Why is this receiving a control, but actually using it as a Form (where the WantingMouseFocus is checked?) /// Because later we might change it to work off the control, specifically, if a control is supplied (normally actually a Form will be supplied) /// </summary> public void ControlInputFocus(System.Windows.Forms.Control c, InputFocus types, bool wants) { if (types.HasFlag(InputFocus.Mouse) && wants) { WantingMouseFocus.Add(c); } if (types.HasFlag(InputFocus.Mouse) && !wants) { WantingMouseFocus.Remove(c); } }
/// <summary> /// If your form needs this kind of input focus, be sure to say so. /// Really, this only makes sense for mouse, but I've started building it out for other things /// Why is this receiving a control, but actually using it as a Form (where the WantingMouseFocus is checked?) /// Because later we might change it to work off the control, specifically, if a control is supplied (normally actually a Form will be supplied) /// </summary> public void ControlInputFocus(Control c, InputFocus types, bool wants) { if (types.HasFlag(InputFocus.Mouse) && wants) { _wantingMouseFocus.Add(c); } if (types.HasFlag(InputFocus.Mouse) && !wants) { _wantingMouseFocus.Remove(c); } }
/// <summary> /// If your form needs this kind of input focus, be sure to say so. /// Really, this only makes sense for mouse, but I've started building it out for other things /// Why is this receiving a control, but actually using it as a Form (where the WantingMouseFocus is checked?) /// Because later we might change it to work off the control, specifically, if a control is supplied (normally actually a Form will be supplied) /// </summary> public void ControlInputFocus(System.Windows.Forms.Control c, InputFocus types, bool wants) { if (types.HasFlag(InputFocus.Mouse) && wants) WantingMouseFocus.Add(c); if (types.HasFlag(InputFocus.Mouse) && !wants) WantingMouseFocus.Remove(c); }