Sprite.Property.01.Owner.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. 
  2. namespace Microsoft.Windows.Forms
  3. {
  4. public partial class Sprite
  5. {
  6. private bool m_AutoFeedback = false;
  7. /// <summary>
  8. /// 是否自动反馈到Owner
  9. /// </summary>
  10. public bool AutoFeedback
  11. {
  12. get
  13. {
  14. return this.m_AutoFeedback;
  15. }
  16. set
  17. {
  18. if (value != this.m_AutoFeedback)
  19. {
  20. this.m_AutoFeedback = value;
  21. }
  22. }
  23. }
  24. private IUIControl m_Owner;
  25. /// <summary>
  26. /// 父控件
  27. /// </summary>
  28. public IUIControl Owner
  29. {
  30. get
  31. {
  32. return this.m_Owner;
  33. }
  34. }
  35. /// <summary>
  36. /// 反馈方法,非强制
  37. /// </summary>
  38. public void Feedback()
  39. {
  40. this.Feedback(false);
  41. }
  42. /// <summary>
  43. /// 反馈方法
  44. /// </summary>
  45. /// <param name="force">是否强制反馈</param>
  46. public void Feedback(bool force)
  47. {
  48. if (this.m_Owner != null && (force || this.m_AutoFeedback))
  49. this.m_Owner.Invalidate();
  50. }
  51. }
  52. }