LayoutEventArgs.cs 905 B

12345678910111213141516171819202122232425262728293031
  1. using System.ComponentModel;
  2. namespace System.Windows.Forms
  3. {
  4. public sealed class LayoutEventArgs : EventArgs
  5. {
  6. private readonly IComponent affectedComponent;
  7. private readonly string affectedProperty;
  8. public IComponent AffectedComponent => affectedComponent;
  9. public Control AffectedControl => affectedComponent as Control;
  10. public string AffectedProperty => affectedProperty;
  11. public LayoutEventArgs(IComponent affectedComponent, string affectedProperty)
  12. {
  13. this.affectedComponent = affectedComponent;
  14. this.affectedProperty = affectedProperty;
  15. }
  16. public LayoutEventArgs(Control affectedControl, string affectedProperty)
  17. : this((IComponent)affectedControl, affectedProperty)
  18. {
  19. }
  20. }
  21. public delegate void LayoutEventHandler(object sender, LayoutEventArgs e);
  22. }